XmlTextReader.BaseURI プロパティ
アセンブリ: System.Xml (system.xml.dll 内)


![]() |
---|
Microsoft .NET Framework version 2.0 リリースでは、System.Xml.XmlReader.Create メソッドを使用して XmlReader インスタンスを作成することをお勧めします。これにより、このリリースで導入された新機能を十分に活用できます。詳細については、「XML リーダーの作成」を参照してください。 |
ネットワーク化した XML ドキュメントは、さまざまな W3C 標準包含機構を使用して集約されたデータのチャンクで構成されるため、異なる場所からのノードを含んでいます。DTD エンティティは、この一例ですが、これは DTD だけに限定されていません。ベース URI は、ノードが存在していた元の位置を通知します。返されているノードのベース URI がない場合 (インメモリ文字列から解析された場合など) は、String.Empty が返されます。

Option Explicit Option Strict Imports System Imports System.IO Imports System.Xml Public Class Sample Public Shared Sub Main() Dim reader As XmlTextReader = Nothing Try 'Load the reader with the XML file. reader = New XmlTextReader("http://localhost/baseuri.xml") 'Parse the file and display the base URI for each node. While reader.Read() Console.WriteLine("({0}) {1}", reader.NodeType, reader.BaseURI) End While Finally If Not (reader Is Nothing) Then reader.Close() End If End Try End Sub 'Main ' End class End Class 'Sample
using System; using System.IO; using System.Xml; public class Sample { public static void Main() { XmlTextReader reader = null; try { //Load the reader with the XML file. reader = new XmlTextReader("http://localhost/baseuri.xml"); //Parse the file and display the base URI for each node. while (reader.Read()) { Console.WriteLine("({0}) {1}", reader.NodeType, reader.BaseURI); } } finally { if (reader!=null) reader.Close(); } } } // End class
#using <System.Xml.dll> using namespace System; using namespace System::IO; using namespace System::Xml; int main() { XmlTextReader^ reader = nullptr; try { //Load the reader with the XML file. reader = gcnew XmlTextReader( "http://localhost/baseuri.xml" ); //Parse the file and display the base URI for each node. while ( reader->Read() ) { Console::WriteLine( "({0}) {1}", reader->NodeType, reader->BaseURI ); } } finally { if ( reader != nullptr ) reader->Close(); } }
import System.*; import System.IO.*; import System.Xml.*; public class Sample { public static void main(String[] args) { XmlTextReader reader = null; try { //Load the reader with the XML file. reader = new XmlTextReader("http://localhost/baseuri.xml"); //Parse the file and display the base URI for each node. while(reader.Read()) { Console.WriteLine("({0}) {1}", reader.get_NodeType(), reader.get_BaseURI()); } } finally { if ( reader != null ) { reader.Close(); } } } //main } // End class Sample

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からXmlTextReader.BaseURI プロパティを検索する場合は、下記のリンクをクリックしてください。

- XmlTextReader.BaseURI プロパティのページへのリンク