XQuery.Serialize Method (TextWriter, XPathItem)XQuery.Serialize Method (TextWriter, XPathItem)XQuery::Serialize Method (TextWriter^, XPathItem^)

Serializes the result of the query to the specified TextWriterTextWriterTextWriter.

Syntax

Public Sub Serialize( _
    writer As System.IO.TextWriter, _
    contextItem As System.Xml.XPath.XPathItem _
)
public void Serialize(
    System.IO.TextWriter writer,
    System.Xml.XPath.XPathItem contextItem
)
public:
void Serialize(
    System.IO::TextWriter^ writer, 
    System.Xml.XPath::XPathItem^ contextItem
)
 

Parameters

writer

Type: System.IO.TextWriterSystem.IO.TextWriterSystem.IO::TextWriter^

The TextWriterTextWriterTextWriter to which the result of the query will be written.

contextItem

Type: System.Xml.XPath.XPathItemSystem.Xml.XPath.XPathItemSystem.Xml.XPath::XPathItem^

The context item for the query.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullException writer or contextItem is null a null reference (Nothing in Visual Basic) nullptr.
InvalidOperationExceptionInvalidOperationExceptionInvalidOperationExceptionThe query is an updating expression.
XdmExceptionXdmExceptionXdmException A dynamic error was encountered while evaluating the query.