XmlDocument.CreateSignificantWhitespace メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > XmlDocument.CreateSignificantWhitespace メソッドの意味・解説 

XmlDocument.CreateSignificantWhitespace メソッド

XmlSignificantWhitespace ノード作成します

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

Public Overridable Function
 CreateSignificantWhitespace ( _
    text As String _
) As XmlSignificantWhitespace
Dim instance As XmlDocument
Dim text As String
Dim returnValue As XmlSignificantWhitespace

returnValue = instance.CreateSignificantWhitespace(text)
public virtual XmlSignificantWhitespace CreateSignificantWhitespace
 (
    string text
)
public:
virtual XmlSignificantWhitespace^ CreateSignificantWhitespace (
    String^ text
)
public XmlSignificantWhitespace CreateSignificantWhitespace (
    String text
)
public function CreateSignificantWhitespace
 (
    text : String
) : XmlSignificantWhitespace

パラメータ

text

文字列には、、
、
、および 	 の文字だけを含める必要があります

戻り値
新しXmlSignificantWhitespace ノード

解説解説
使用例使用例

ドキュメント有意な空白追加する例を次に示します

Option Explicit
Option Strict

Imports System
Imports System.Xml
Imports Microsoft.VisualBasic

Public Class Sample
    
    Public Shared Sub Main()
        
        Dim doc As New XmlDocument()
        doc.LoadXml("<author xml:space='preserve'>"
 & _
                    "<first-name>Eva</first-name>"
 & _
                    "<last-name>Corets</last-name>"
 & _
                    "</author>")
            
        Console.WriteLine("InnerText before...")
        Console.WriteLine(doc.DocumentElement.InnerText)
            
        ' Add white space.    
        Dim currNode as XmlNode = doc.DocumentElement
        Dim sigws As XmlSignificantWhitespace
 = doc.CreateSignificantWhitespace(ControlChars.Tab)
        currNode.InsertAfter(sigws, currNode.FirstChild)
            
        Console.WriteLine()
        Console.WriteLine("InnerText after...")
        Console.WriteLine(doc.DocumentElement.InnerText)
        
    End Sub 
End Class 'Sample

using System;
using System.Xml;

public class Sample {
  
  public static void Main()
 {

      XmlDocument doc = new XmlDocument();
      doc.LoadXml("<author xml:space='preserve'>" +
                  "<first-name>Eva</first-name>"+
                  "<last-name>Corets</last-name>" + 
                  "</author>"); 
        
      Console.WriteLine("InnerText before...");
      Console.WriteLine(doc.DocumentElement.InnerText);

      // Add white space.     
      XmlNode currNode = doc.DocumentElement;
      XmlSignificantWhitespace sigws = doc.CreateSignificantWhitespace("\t");
      currNode.InsertAfter(sigws, currNode.FirstChild);

      Console.WriteLine();
      Console.WriteLine("InnerText after...");
      Console.WriteLine(doc.DocumentElement.InnerText);

  } 
}
#using <System.Xml.dll>

using namespace System;
using namespace System::Xml;
int main()
{
   XmlDocument^ doc = gcnew XmlDocument;
   doc->LoadXml( "<author xml:space='preserve'><first-name>Eva</first-name><last-name>Corets</last-name></author>"
 );
   Console::WriteLine( "InnerText before..." );
   Console::WriteLine( doc->DocumentElement->InnerText );
   
   // Add white space.     
   XmlNode^ currNode = doc->DocumentElement;
   XmlSignificantWhitespace^ sigws = doc->CreateSignificantWhitespace( "\t"
 );
   currNode->InsertAfter( sigws, currNode->FirstChild );
   Console::WriteLine();
   Console::WriteLine( "InnerText after..." );
   Console::WriteLine( doc->DocumentElement->InnerText );
}

import System.*;
import System.Xml.*;

public class Sample
{
    public static void main(String[]
 args)
    {
        XmlDocument doc = new XmlDocument();
        doc.LoadXml("<author xml:space='preserve'>"
                    + "<first-name>Eva</first-name>"
                    + "<last-name>Corets</last-name>"
                    + "</author>");

        Console.WriteLine("InnerText before...");
        Console.WriteLine(doc.get_DocumentElement().get_InnerText());

        // Add white space.     
        XmlNode currNode = doc.get_DocumentElement();
        XmlSignificantWhitespace sigWs = doc.CreateSignificantWhitespace("\t");
        currNode.InsertAfter(sigWs, currNode.get_FirstChild());

        Console.WriteLine();
        Console.WriteLine("InnerText after...");
        Console.WriteLine(doc.get_DocumentElement().get_InnerText());
    } //main
} //Sample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

XmlDocument.CreateSignificantWhitespace メソッドのお隣キーワード
検索ランキング

   

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



XmlDocument.CreateSignificantWhitespace メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS