XmlDeclaration.Standalone プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > XmlDeclaration.Standalone プロパティの意味・解説 

XmlDeclaration.Standalone プロパティ

スタンドアロン属性の値を取得または設定します

名前空間: System.Xml
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

使用例使用例

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からXmlDeclaration.Standalone プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からXmlDeclaration.Standalone プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からXmlDeclaration.Standalone プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

XmlDeclaration.Standalone プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



XmlDeclaration.Standalone プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS