C# Class Mvp.Xml.Common.XPath.XPathDocumentWriter

XmlWriter that can produce an XPathDocument without the need to parse XML.
Using this writer whenever you need to perform fast chained transformations. Using this class avoids reparsing of the intermediate output, yielding lower memory and CPU usage.

Future versions of XPathDocument may offer this functionality out of the box.

Important: this class requires unrestricted member access reflection permissions in order to run. If the Mvp.Xml assembly is installed in the GAC, it will run without problems. The Mvp.Xml allows partially trusted callers, so only this assembly needs to be GAC'ed.

Alternatively, you can configure .NET security policy to allow the appropriate permission (see ReflectionPermission, PermissionState.Unrestricted and ReflectionPermissionFlag.MemberAccess).

Inheritance: System.Xml.XmlWrappingWriter
Afficher le fichier Open project: Monobjc/monobjc-tools Class Usage Examples

Méthodes publiques

Méthode Description
Close ( ) : XPathDocument

Closes the writer and retrieves the created XPathDocument.

WriteStartElement ( string prefix, string localName, string ns ) : void

See XmlWriter.WriteStartElement(string, string, string).

XPathDocumentWriter ( string baseUri ) : System

Initializes a new instance of XPathDocumentWriter using the given baseUri.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Never disposes the underlying writer as it's not keeping in-memory state.

This override also avoids an exception that is thrown otherwise by the base System.Xml.XmlRawWriter being used internally.

Private Methods

Méthode Description
CreateDocument ( ) : XPathDocument
GetWriter ( XPathDocument document, string baseUri ) : XmlWriter
XPathDocumentWriter ( ) : System

Method Details

Close() public méthode

Closes the writer and retrieves the created XPathDocument.
public Close ( ) : XPathDocument
Résultat System.Xml.XPath.XPathDocument

Dispose() protected méthode

Never disposes the underlying writer as it's not keeping in-memory state.
This override also avoids an exception that is thrown otherwise by the base System.Xml.XmlRawWriter being used internally.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

WriteStartElement() public méthode

See XmlWriter.WriteStartElement(string, string, string).
public WriteStartElement ( string prefix, string localName, string ns ) : void
prefix string
localName string
ns string
Résultat void

XPathDocumentWriter() public méthode

Initializes a new instance of XPathDocumentWriter using the given baseUri.
public XPathDocumentWriter ( string baseUri ) : System
baseUri string Base URI to used to construct the .
Résultat System