XdmWriter.Serialize Method (XmlReader, XmlWriter)XdmWriter.Serialize Method (XmlReader, XmlWriter)XdmWriter::Serialize Method (XmlReader^, XmlWriter^)

Serializes content from an XmlReaderXmlReaderXmlReader instance to an XmlWriterXmlWriterXmlWriter.

Syntax

Public Shared Sub Serialize( _
    reader As System.Xml.XmlReader, _
    writer As System.Xml.XmlWriter _
)
public static void Serialize(
    System.Xml.XmlReader reader,
    System.Xml.XmlWriter writer
)
public:
static void Serialize(
    System.Xml::XmlReader^ reader, 
    System.Xml::XmlWriter^ writer
)
 

Parameters

reader

Type: System.Xml.XmlReaderSystem.Xml.XmlReaderSystem.Xml::XmlReader^

The document to serialize.

writer

Type: System.Xml.XmlWriterSystem.Xml.XmlWriterSystem.Xml::XmlWriter^

The writer to serialize to.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullException reader or writer is null a null reference (Nothing in Visual Basic) nullptr.
XdmExceptionXdmExceptionXdmExceptionAn error occurred during serialization.

Remarks

If the ConformanceLevelConformanceLevelConformanceLevel property of the has value DocumentDocumentDocument, then only the subtree on which reader is positioned and any following comment, processing instuctions and whitespace nodes will be serialized. Otherwise, the subtree on which reader is positioned together with any siblings. will be serialized.