System.Xml.XmlParserContext Class

public class XmlParserContext

Base Types

Object
  XmlParserContext

Assembly

System.Xml

Library

XML

Summary

Provides all the context information required by instances of the XmlTextReader class to parse an XML fragment.

See Also

System.Xml Namespace

Members

XmlParserContext Constructors

XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.Xml.XmlSpace) Constructor
XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.Xml.XmlSpace, System.Text.Encoding) Constructor
XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.String, System.String, System.String, System.String, System.String, System.Xml.XmlSpace) Constructor
XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.String, System.String, System.String, System.String, System.String, System.Xml.XmlSpace, System.Text.Encoding) Constructor

XmlParserContext Properties

XmlParserContext.BaseURI Property
XmlParserContext.DocTypeName Property
XmlParserContext.Encoding Property
XmlParserContext.InternalSubset Property
XmlParserContext.NameTable Property
XmlParserContext.NamespaceManager Property
XmlParserContext.PublicId Property
XmlParserContext.SystemId Property
XmlParserContext.XmlLang Property
XmlParserContext.XmlSpace Property


XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.Xml.XmlSpace) Constructor

public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string xmlLang, XmlSpace xmlSpace);

Summary

Constructs and initializes a new instance of the XmlParserContext class with the specified values.

Parameters

nt
The XmlNameTable to use. If nt is null , this defaults to the XmlNameTable used to construct nsMgr.
nsMgr
The XmlNamespaceManager to use for looking up namespace information, or null .
xmlLang
A String specifying the xml:lang scope.
xmlSpace
A XmlSpace value indicating the xml:space scope.

Exceptions

Exception TypeCondition
XmlExceptionnt is not the same XmlNameTable used to construct nsMgr.

Description

This method is equivalent to XmlParserContext(nt, nsMgr, null , null , null , null , System.String.Empty, xmlLang, xmlSpace, null ) constructor.

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.Xml.XmlSpace, System.Text.Encoding) Constructor

public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string xmlLang, XmlSpace xmlSpace, Encoding enc);

Summary

Constructs and initializes a new instance of the XmlParserContext class with the specified values.

Parameters

nt
The XmlNameTable to use. If nt is null , this defaults to the XmlNameTable used to construct nsMgr.
nsMgr
The XmlNamespaceManager to use for looking up namespace information, or null .
xmlLang
A String specifying the xml:lang scope.
xmlSpace
A XmlSpace value indicating the xml:space scope.
enc
An instance of a class derived from the Encoding class indicating the encoding to use.

Exceptions

Exception TypeCondition
XmlExceptionnt is not the same XmlNameTable used to construct nsMgr.

Description

This method is equivalent to XmlParserContext(nt, nsMgr, null , null , null , null , System.String.Empty, xmlLang, xmlSpace, enc).

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.String, System.String, System.String, System.String, System.String, System.Xml.XmlSpace) Constructor

public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string docTypeName, string pubId, string sysId, string internalSubset, string baseURI, string xmlLang, XmlSpace xmlSpace);

Summary

Constructs and initializes a new instance of the XmlParserContext class with the specified values.

Parameters

nt
The XmlNameTable to use. If nt is null , this defaults to the XmlNameTable used to construct nsMgr.
nsMgr
The XmlNamespaceManager to use for looking up namespace information, or null .
docTypeName
A String specifying the name of the document type declaration.
pubId
A String specifying the public identifier.
sysId
A String specifying the system identifier.
internalSubset
A String specifying the internal DTD subset.
baseURI
A String specifying the base URI for the XML fragment (the location from which the fragment was loaded).
xmlLang
A String containing the xml:lang scope.
xmlSpace
A XmlSpace value indicating the xml:space scope.

Exceptions

Exception TypeCondition
XmlExceptionnt is not the same XmlNameTable used to construct nsMgr.

Description

This method is equivalent to XmlParserContext(nt, nsMgr, docTypeName, pubId, sysId, internalSubset, baseUri, xmlLang, xmlSpace, null ).

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.String, System.String, System.String, System.String, System.String, System.Xml.XmlSpace, System.Text.Encoding) Constructor

public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string docTypeName, string pubId, string sysId, string internalSubset, string baseURI, string xmlLang, XmlSpace xmlSpace, Encoding enc);

Summary

Constructs and initializes a new instance of the XmlParserContext class with the specified values.

Parameters

nt
The XmlNameTable to use. If nt is null , this defaults to the XmlNameTable used to construct nsMgr.
nsMgr
The XmlNamespaceManager to use for looking up namespace information, or null .
docTypeName
A String specifying the name of the document type declaration.
pubId
A String specifying the public identifier.
sysId
A String specifying the system identifier.
internalSubset
A String specifying the internal DTD subset.
baseURI
A String specifying the base URI for the XML fragment (the location from which the fragment was loaded).
xmlLang
A String specifying the xml:lang scope.
xmlSpace
A XmlSpace value indicating the xml:space scope.
enc
The Encoding to use.

Exceptions

Exception TypeCondition
XmlExceptionnt is not the same XmlNameTable used to construct nsMgr.

Description

The constructor sets System.Xml.XmlParserContext.BaseURI to baseURI, System.Xml.XmlParserContext.DocTypeName to docTypeName, System.Xml.XmlParserContext.InternalSubset to internalSubset, System.Xml.XmlParserContext.PublicId to pubId, System.Xml.XmlParserContext.SystemId to sysId, and System.Xml.XmlParserContext.XmlLang to xmlLang. If null is passed for any of these parameters, the corresponding property is set to System.String.Empty.

[Note: The DocumentType (DTD) information stored in this constructor is ignored when an instance of the class is passed to a XmlTextReader.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.BaseURI Property

public string BaseURI { get; set; }

Summary

Gets or sets the base URI.

Property Value

A String specifying the base URI to use for resolving the DTD file.

Description

If an attempt is made to set this property to null , it is set to System.String.Empty.

[Note: A networked XML document is comprised of chunks of data aggregated using various W3C standard inclusion mechanisms and therefore can contain nodes that come from different places. The System.Xml.XmlParserContext.BaseURI property shows where these nodes originated.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.DocTypeName Property

public string DocTypeName { get; set; }

Summary

Gets or sets the name of the document type in a document type declaration.

Property Value

A String specifying the name of the document type.

Description

If an attempt is made to set this property to null , it is set to System.String.Empty.

[Note: A document type declaration is of the following form:

<!DOCTYPE DocTypeName PUBLIC "PublicId" "SystemId" [InternalSubset]>

This property, along with System.Xml.XmlParserContext.InternalSubset, System.Xml.XmlParserContext.PublicId, and System.Xml.XmlParserContext.SystemId properties, provide all the document type declaration information.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.Encoding Property

public Encoding Encoding { get; set; }

Summary

Gets or sets the encoding type.

Property Value

A Encoding indicating the encoding type.

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.InternalSubset Property

public string InternalSubset { get; set; }

Summary

Gets or sets the internal subset in a document type declaration.

Property Value

A String specifying the internal subset.

Description

If an attempt is made to set this property to null , it is set to System.String.Empty.

[Note: A document type declaration is of the following form:

<!DOCTYPE DocTypeName PUBLIC "PublicId" "SystemId" [InternalSubset]>

This property, along with System.Xml.XmlParserContext.DocTypeName, System.Xml.XmlParserContext.PublicId, and System.Xml.XmlParserContext.SystemId properties, provide all the document type declaration information.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.NameTable Property

public XmlNameTable NameTable { get; set; }

Summary

Gets or sets the XmlNameTable used by the current instance to look up prefixes and namespace URIs.

Property Value

The XmlNameTable used by the current instance.

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.NamespaceManager Property

public XmlNamespaceManager NamespaceManager { get; set; }

Summary

Gets or sets the XmlNamespaceManager used by the current instance.

Property Value

The XmlNamespaceManager used by the current instance.

Description

[Note: A XmlNamespaceManager defines the current namespace scope and provides methods for looking up namespace information.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.PublicId Property

public string PublicId { get; set; }

Summary

Gets or sets the public identifier in a document type declaration.

Property Value

A String specifying the public identifier.

Description

If an attempt is made to set this property to null , it is set to System.String.Empty.

[Note: A document type declaration is of the following form:

<!DOCTYPE DocTypeName PUBLIC "PublicId" "SystemId" [InternalSubset]>

This property, along with System.Xml.XmlParserContext.DocTypeName, System.Xml.XmlParserContext.InternalSubset, and System.Xml.XmlParserContext.SystemId properties, provide all the document type declaration information.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.SystemId Property

public string SystemId { get; set; }

Summary

Gets or sets the system identifier in a document type declaration.

Property Value

A String specifying the system identifier.

Description

If an attempt is made to set this property to null , it is set to System.String.Empty.

[Note: A document type declaration is of the following form:

<!DOCTYPE DocTypeName PUBLIC "PublicId" "SystemId" [InternalSubset]>

This property, along with System.Xml.XmlParserContext.DocTypeName, System.Xml.XmlParserContext.InternalSubset, and System.Xml.XmlParserContext.PublicId properties, provide all the document type declaration information.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.XmlLang Property

public string XmlLang { get; set; }

Summary

Gets or sets the current xml:lang scope.

Property Value

A String specifying the current xml:lang scope. If there is no xml:lang in scope, System.String.Empty is returned.

Description

If an attempt is made to set this property to null , it is set to System.String.Empty.

[Note: The language attribute, xml:lang, specifies the language in which the content and attribute values of the current element are written.

For details on valid xml:lang values, refer to section 2.12 of the W3C Extensible Markup Language (XML) 1.0 recommendation.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace

XmlParserContext.XmlSpace Property

public XmlSpace XmlSpace { get; set; }

Summary

Gets or sets the current xml:space scope.

Property Value

One of the members of the XmlSpace enumeration indicating the xml:space scope.

Description

[Note: The white space attribute, xml:space, specifies how white space is handled in the current element.

]

See Also

System.Xml.XmlParserContext Class, System.Xml Namespace