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

プリフィックスを削除した現在のノードの名前。たとえば、LocalName は、要素 <bk:book> の book です。 名前を持たないノード型 (Text、Comment など) の場合、このプロパティは String.Empty を返します。

各ノードのローカル名を表示する例を次に示します。プリフィックスと名前空間 URI が存在する場合は、それらも表示します。
Dim reader As XmlReader = XmlReader.Create("book2.xml") ' Parse the file. If they exist, display the prefix and ' namespace URI of each node. While reader.Read() If reader.IsStartElement() Then If reader.Prefix = String.Empty Then Console.WriteLine("<{0}>", reader.LocalName) Else Console.Write("<{0}:{1}>", reader.Prefix, reader.LocalName) Console.WriteLine(" The namespace URI is " + reader.NamespaceURI) End If End If End While reader.Close()
XmlReader reader = XmlReader.Create("book2.xml"); // Parse the file. If they exist, display the prefix and // namespace URI of each node. while (reader.Read()) { if (reader.IsStartElement()) { if (reader.Prefix==String.Empty) Console.WriteLine("<{0}>", reader.LocalName); else { Console.Write("<{0}:{1}>", reader.Prefix, reader.LocalName); Console.WriteLine(" The namespace URI is " + reader.NamespaceURI); } } } reader.Close();

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に収録されているすべての辞書からXmlReader.LocalName プロパティを検索する場合は、下記のリンクをクリックしてください。

- XmlReader.LocalName プロパティのページへのリンク