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

Dim instance As XmlDeclaration Dim value As String value = instance.Standalone instance.Standalone = value
/** @property */ public String get_Standalone () /** @property */ public void set_Standalone (String value)
XML ドキュメントで必要なすべてのエンティティ宣言がドキュメント内に格納されている場合、有効値は yes です。外部の文書型宣言 (DTD : Document Type Definition) が必要な場合は no です。XML 宣言内にスタンドアロン属性が存在しない場合、このプロパティは String.Empty を返します。

XmlDeclaration ノードを作成し、XML ドキュメントに追加する例を次に示します。
Imports System Imports System.IO Imports System.Xml public class Sample public shared sub Main() ' Create and load the XML document. Dim doc as XmlDocument = new XmlDocument() Dim xmlString as string = "<book><title>Oberon's Legacy</title></book>" doc.Load(new StringReader(xmlString)) ' Create an XML declaration. Dim xmldecl as XmlDeclaration xmldecl = doc.CreateXmlDeclaration("1.0",nothing, nothing) xmldecl.Encoding="UTF-8" xmldecl.Standalone="yes" ' Add the new node to the document. Dim root as XmlElement = doc.DocumentElement doc.InsertBefore(xmldecl, root) ' Display the modified XML document Console.WriteLine(doc.OuterXml) end sub end class
using System; using System.IO; using System.Xml; public class Sample { public static void Main() { // Create and load the XML document. XmlDocument doc = new XmlDocument(); string xmlString = "<book><title>Oberon's Legacy</title></book>"; doc.Load(new StringReader(xmlString)); // Create an XML declaration. XmlDeclaration xmldecl; xmldecl = doc.CreateXmlDeclaration("1.0",null,null); xmldecl.Encoding="UTF-8"; xmldecl.Standalone="yes"; // Add the new node to the document. XmlElement root = doc.DocumentElement; doc.InsertBefore(xmldecl, root); // Display the modified XML document Console.WriteLine(doc.OuterXml); } }
#using <System.Xml.dll> using namespace System; using namespace System::IO; using namespace System::Xml; int main() { // Create and load the XML document. XmlDocument^ doc = gcnew XmlDocument; String^ xmlString = "<book><title>Oberon's Legacy</title></book>"; doc->Load( gcnew StringReader( xmlString ) ); // Create an XML declaration. XmlDeclaration^ xmldecl; xmldecl = doc->CreateXmlDeclaration( "1.0", nullptr, nullptr ); xmldecl->Encoding = "UTF-8"; xmldecl->Standalone = "yes"; // Add the new node to the document. XmlElement^ root = doc->DocumentElement; doc->InsertBefore( xmldecl, root ); // Display the modified XML document Console::WriteLine( doc->OuterXml ); }
import System.*; import System.IO.*; import System.Xml.*; public class Sample { public static void main(String[] args) { // Create and load the XML document. XmlDocument doc = new XmlDocument(); String xmlString = "<book><title>Oberon's Legacy</title></book>"; doc.Load(new StringReader(xmlString)); // Create an XML declaration. XmlDeclaration xmlDecl; xmlDecl = doc.CreateXmlDeclaration("1.0", null, null); xmlDecl.set_Encoding("UTF-8"); xmlDecl.set_Standalone("yes"); // Add the new node to the document. XmlElement root = doc.get_DocumentElement(); doc.InsertBefore(xmlDecl, root); // Display the modified XML document Console.WriteLine(doc.get_OuterXml()); } //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に収録されているすべての辞書からXmlDeclaration.Standalone プロパティを検索する場合は、下記のリンクをクリックしてください。

- XmlDeclaration.Standalone プロパティのページへのリンク