XMLWriter::flushとは? わかりやすく解説

Weblio 辞書 > コンピュータ > PHP関数リファレンス > XMLWriter::flushの意味・解説 

XMLWriter::flush

(PHP 5 >= 5.1.2)
XMLWriter::flush — 現在のバッファをフラッシュする

説明

オブジェクト指向型
class XMLWriter {
mixed flush ( [bool empty] )
} 手続き型
mixed xmlwriter_flush ( resource xmlwriter [, bool empty] )
現在のバッファをフラッシュします。

パラメータ

xmlwriter
手続き型のコールでのみ使用します。 変更される XMLWriter resource です。 このリソースは、xmlwriter_open_uri() あるいは xmlwriter_open_memory() のコールによって取得したものです。
empty
バッファを空にするかどうか。デフォルトは TRUE です。

返り値

ライターをメモリにオープンした場合は、この関数は出来上がった XML バッファを返します。 そうではなく URI を使用している場合は、この関数はバッファを書き込み、 書き込んだバイト数を返します。

XmlWriter.Flush メソッド

派生クラスオーバーライドされると、バッファ内のデータをすべて基になるストリームフラッシュし、基になるストリームフラッシュます。

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

解説解説
使用例使用例

2 つXML フラグメント書き込む例を次に示します

Imports System
Imports System.IO
Imports System.Xml

Public Class Sample

  Public Shared Sub Main()

     ' Create an XmlWriter to write XML fragments.
     Dim settings As XmlWriterSettings = new
 XmlWriterSettings()
     settings.ConformanceLevel = ConformanceLevel.Fragment
     settings.Indent = true
     Dim writer As XmlWriter = XmlWriter.Create(Console.Out,
 settings)
    
     ' Write an XML fragment.
     writer.WriteStartElement("book")
     writer.WriteElementString("title", "Pride
 And Prejudice")
     writer.WriteEndElement()
     writer.Flush()

     ' Write another XML fragment.
     writer.WriteStartElement("cd")
     writer.WriteElementString("title", "Americana")
     writer.WriteEndElement()
     writer.Flush()  

     'Close the writer.
     writer.Close()

  End Sub
End Class
using System;
using System.IO;
using System.Xml;

public class Sample {

  public static void Main()
 {
 
     // Create an XmlWriter to write XML fragments.
     XmlWriterSettings settings = new XmlWriterSettings();
     settings.ConformanceLevel = ConformanceLevel.Fragment;
     settings.Indent = true;
     XmlWriter writer = XmlWriter.Create(Console.Out, settings);
     
     // Write an XML fragment.
     writer.WriteStartElement("book");
     writer.WriteElementString("title", "Pride And Prejudice");
     writer.WriteEndElement();
     writer.Flush();

     // Write another XML fragment.
     writer.WriteStartElement("cd");
     writer.WriteElementString("title", "Americana");
     writer.WriteEndElement();
     writer.Flush();  

     // Close the writer.
     writer.Close();
  }
}
#using <System.Xml.dll>

using namespace System;
using namespace System::IO;
using namespace System::Xml;
void main()
{
   
   // Create an XmlWriter to write XML fragments.
   XmlWriterSettings^ settings = gcnew XmlWriterSettings;
   settings->ConformanceLevel = ConformanceLevel::Fragment;
   settings->Indent = true;
   XmlWriter^ writer = XmlWriter::Create( Console::Out, settings );
   
   // Write an XML fragment.
   writer->WriteStartElement( L"book" );
   writer->WriteElementString( L"title", L"Pride And Prejudice"
 );
   writer->WriteEndElement();
   writer->Flush();
   
   // Write another XML fragment.
   writer->WriteStartElement( L"cd" );
   writer->WriteElementString( L"title", L"Americana" );
   writer->WriteEndElement();
   writer->Flush();
   
   // Close the writer.
   writer->Close();
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

辞書ショートカット

すべての辞書の索引

「XMLWriter::flush」の関連用語

XMLWriter::flushのお隣キーワード
検索ランキング

   

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



XMLWriter::flushのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2025 by the PHP Documentation Group.
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS