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


ネットワーク化した XML ドキュメントは、さまざまな W3C (World Wide Web Consortium) 標準包含機構を使用して集約されたデータのチャンクで構成されるため、異なる場所からのノードを含んでいます。BaseURI は、ノードが存在していた元の位置を通知します。返されるノードのベース URI がない場合 (インメモリ文字列から解析された可能性がある) は、String.Empty が返されます。
BaseURI は、ノード ツリーでエンティティ参照の境界を検索するため、エンティティが展開された場合、この情報は保存されず、このプロパティは常に XmlDocument の位置を返します。
BaseURI および他の種類のノードでのその動作の詳細については、XmlNode.BaseURI のトピックを参照してください。
このプロパティは、DOM (Document Object Model) に対する Microsoft 拡張機能です。

ベース URI を含む、エンティティ参照ノードに関する情報を表示する例を次に示します。
Imports System Imports System.IO Imports System.Xml public class Sample public shared sub Main() 'Create the XmlDocument. Dim doc as XmlDocument = new XmlDocument() doc.Load("http://localhost/uri.xml") 'Display information on the entity reference node. Dim entref as XmlEntityReference = CType(doc.DocumentElement.LastChild.FirstChild, XmlEntityReference) Console.WriteLine("Name of the entity reference: {0}", entref.Name) Console.WriteLine("Base URI of the entity reference: {0}", entref.BaseURI) Console.WriteLine("The entity replacement text: {0}", entref.InnerText) end sub end class
using System; using System.IO; using System.Xml; public class Sample { public static void Main() { //Create the XmlDocument. XmlDocument doc = new XmlDocument(); doc.Load("http://localhost/uri.xml"); //Display information on the entity reference node. XmlEntityReference entref = (XmlEntityReference) doc.DocumentElement.LastChild.FirstChild; Console.WriteLine("Name of the entity reference: {0}", entref.Name); Console.WriteLine("Base URI of the entity reference: {0}", entref.BaseURI); Console.WriteLine("The entity replacement text: {0}", entref.InnerText); } }
#using <System.Xml.dll> using namespace System; using namespace System::IO; using namespace System::Xml; int main() { //Create the XmlDocument. XmlDocument^ doc = gcnew XmlDocument; doc->Load( "http://localhost/uri.xml" ); //Display information on the entity reference node. XmlEntityReference^ entref = dynamic_cast<XmlEntityReference^>(doc->DocumentElement->LastChild->FirstChild); Console::WriteLine( "Name of the entity reference: {0}", entref->Name ); Console::WriteLine( "Base URI of the entity reference: {0}", entref->BaseURI ); Console::WriteLine( "The entity replacement text: {0}", entref->InnerText ); }
import System.*; import System.IO.*; import System.Xml.*; public class Sample { public static void main(String[] args) { //Create the XmlDocument. XmlDocument doc = new XmlDocument(); doc.Load("http://localhost/uri.xml"); //Display information on the entity reference node. XmlEntityReference entRef = (XmlEntityReference) doc.get_DocumentElement().get_LastChild().get_FirstChild(); Console.WriteLine("Name of the entity reference: {0}", entRef.get_Name()); Console.WriteLine("Base URI of the entity reference: {0}", entRef.get_BaseURI()); Console.WriteLine("The entity replacement text: {0}", entRef.get_InnerText()); } //main } //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に収録されているすべての辞書からXmlEntityReference.BaseURI プロパティを検索する場合は、下記のリンクをクリックしてください。

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