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

ノードの読み込み元の場所。ノードにベース URI がない場合は String.Empty。属性ノードのベース URI は、その所有者要素と同じです。属性ノードに所有者要素がない場合、BaseURI は String.Empty を返します。

ネットワーク化した XML ドキュメントは、さまざまな W3C (World Wide Web Consortium) 標準包含機構を使用して集約されたデータのチャンクで構成されるため、異なる場所からのノードを含んでいます。BaseURI プロパティは、ノードが存在していた元の位置を通知します。
BaseURI および他の種類のノードでのその動作の詳細については、XmlNode.BaseURI のトピックを参照してください。
このプロパティは、DOM (Document Object Model) に対する Microsoft 拡張機能です。

属性ノードの情報をそのベース URI も含めて表示する例を次に示します。
Option Explicit Option Strict Imports System Imports System.IO Imports System.Xml Public Class Sample Public Shared Sub Main() 'Create the XmlDocument. Dim doc As New XmlDocument() doc.Load("http://localhost/baseuri.xml") 'Display information on the attribute node. The value 'returned for BaseURI is 'http://localhost/baseuri.xml'. Dim attr As XmlAttribute = doc.DocumentElement.Attributes(0) Console.WriteLine("Name of the attribute: {0}", attr.Name) Console.WriteLine("Base URI of the attribute: {0}", attr.BaseURI) Console.WriteLine("The value of the attribute: {0}", attr.InnerText) End Sub 'Main End Class 'Sample
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/baseuri.xml"); //Display information on the attribute node. The value //returned for BaseURI is 'http://localhost/baseuri.xml'. XmlAttribute attr = doc.DocumentElement.Attributes[0]; Console.WriteLine("Name of the attribute: {0}", attr.Name); Console.WriteLine("Base URI of the attribute: {0}", attr.BaseURI); Console.WriteLine("The value of the attribute: {0}", attr.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/baseuri.xml" ); //Display information on the attribute node. The value //returned for BaseURI is 'http://localhost/baseuri.xml'. XmlAttribute^ attr = doc->DocumentElement->Attributes[ 0 ]; Console::WriteLine( "Name of the attribute: {0}", attr->Name ); Console::WriteLine( "Base URI of the attribute: {0}", attr->BaseURI ); Console::WriteLine( "The value of the attribute: {0}", attr->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/baseuri.xml"); //Display information on the attribute node. The value //returned for BaseURI is 'http://localhost/baseuri.xml'. XmlAttribute attr = doc.get_DocumentElement().get_Attributes().get_ItemOf(0); Console.WriteLine("Name of the attribute: {0}", attr.get_Name()); Console.WriteLine("Base URI of the attribute: {0}",attr.get_BaseURI()); Console.WriteLine("The value of the attribute: {0}", attr.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に収録されているすべての辞書からXmlAttribute.BaseURI プロパティを検索する場合は、下記のリンクをクリックしてください。

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