public class XmlParserContext
Object
XmlParserContext
System.Xml
XML
Provides all the context information required by instances of the XmlTextReader class to parse an XML fragment.
System.Xml Namespace
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
public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string xmlLang, XmlSpace xmlSpace);
Constructs and initializes a new instance of the XmlParserContext class with the specified values.
- 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.
Exception Type Condition XmlException nt is not the same XmlNameTable used to construct nsMgr.
This method is equivalent to XmlParserContext(nt, nsMgr,null
,null
,null
,null
, System.String.Empty, xmlLang, xmlSpace,null
) constructor.
System.Xml.XmlParserContext Class, System.Xml Namespace
public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string xmlLang, XmlSpace xmlSpace, Encoding enc);
Constructs and initializes a new instance of the XmlParserContext class with the specified values.
- 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.
Exception Type Condition XmlException nt is not the same XmlNameTable used to construct nsMgr.
This method is equivalent to XmlParserContext(nt, nsMgr,null
,null
,null
,null
, System.String.Empty, xmlLang, xmlSpace, enc).
System.Xml.XmlParserContext Class, System.Xml Namespace
public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string docTypeName, string pubId, string sysId, string internalSubset, string baseURI, string xmlLang, XmlSpace xmlSpace);
Constructs and initializes a new instance of the XmlParserContext class with the specified values.
- 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.
Exception Type Condition XmlException nt is not the same XmlNameTable used to construct nsMgr.
This method is equivalent to XmlParserContext(nt, nsMgr, docTypeName, pubId, sysId, internalSubset, baseUri, xmlLang, xmlSpace,null
).
System.Xml.XmlParserContext Class, System.Xml Namespace
public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, string docTypeName, string pubId, string sysId, string internalSubset, string baseURI, string xmlLang, XmlSpace xmlSpace, Encoding enc);
Constructs and initializes a new instance of the XmlParserContext class with the specified values.
- 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.
Exception Type Condition XmlException nt is not the same XmlNameTable used to construct nsMgr.
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. Ifnull
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.
]
System.Xml.XmlParserContext Class, System.Xml Namespace
public string BaseURI { get; set; }
Gets or sets the base URI.
A String specifying the base URI to use for resolving the DTD file.
If an attempt is made to set this property tonull
, 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.
]
System.Xml.XmlParserContext Class, System.Xml Namespace
public string DocTypeName { get; set; }
Gets or sets the name of the document type in a document type declaration.
A String specifying the name of the document type.
If an attempt is made to set this property tonull
, 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.
]
System.Xml.XmlParserContext Class, System.Xml Namespace
public Encoding Encoding { get; set; }
Gets or sets the encoding type.
A Encoding indicating the encoding type.
System.Xml.XmlParserContext Class, System.Xml Namespace
public string InternalSubset { get; set; }
Gets or sets the internal subset in a document type declaration.
A String specifying the internal subset.
If an attempt is made to set this property tonull
, 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.
]
System.Xml.XmlParserContext Class, System.Xml Namespace
public XmlNameTable NameTable { get; set; }
Gets or sets the XmlNameTable used by the current instance to look up prefixes and namespace URIs.
The XmlNameTable used by the current instance.
System.Xml.XmlParserContext Class, System.Xml Namespace
public XmlNamespaceManager NamespaceManager { get; set; }
Gets or sets the XmlNamespaceManager used by the current instance.
The XmlNamespaceManager used by the current instance.
[Note: A XmlNamespaceManager defines the current namespace scope and provides methods for looking up namespace information.]
System.Xml.XmlParserContext Class, System.Xml Namespace
public string PublicId { get; set; }
Gets or sets the public identifier in a document type declaration.
A String specifying the public identifier.
If an attempt is made to set this property tonull
, 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.
]
System.Xml.XmlParserContext Class, System.Xml Namespace
public string SystemId { get; set; }
Gets or sets the system identifier in a document type declaration.
A String specifying the system identifier.
If an attempt is made to set this property tonull
, 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.
]
System.Xml.XmlParserContext Class, System.Xml Namespace
public string XmlLang { get; set; }
Gets or sets the currentxml:lang
scope.
A String specifying the currentxml:lang
scope. If there is noxml:lang
in scope, System.String.Empty is returned.
If an attempt is made to set this property tonull
, 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.]
System.Xml.XmlParserContext Class, System.Xml Namespace
public XmlSpace XmlSpace { get; set; }
Gets or sets the currentxml:space
scope.
One of the members of the XmlSpace enumeration indicating thexml:space
scope.
[Note: The white space attribute,xml:space
, specifies how white space is handled in the current element.]
System.Xml.XmlParserContext Class, System.Xml Namespace