mscorlib(4.0.0.0) API with additions
|
Represents an XML document. You can use this class to load, validate, edit, add, and position XML in a document. More...
Public Member Functions | |
XmlDocument () | |
Initializes a new instance of the T:System.Xml.XmlDocument class. More... | |
XmlDocument (XmlNameTable nt) | |
Initializes a new instance of the XmlDocument class with the specified T:System.Xml.XmlNameTable. More... | |
override XmlNode | CloneNode (bool deep) |
Creates a duplicate of this node. More... | |
XmlAttribute | CreateAttribute (string name) |
Creates an T:System.Xml.XmlAttribute with the specified P:System.Xml.XmlDocument.Name. More... | |
virtual XmlCDataSection | CreateCDataSection (string data) |
Creates an T:System.Xml.XmlCDataSection containing the specified data. More... | |
virtual XmlComment | CreateComment (string data) |
Creates an T:System.Xml.XmlComment containing the specified data. More... | |
virtual XmlDocumentType | CreateDocumentType (string name, string publicId, string systemId, string internalSubset) |
Returns a new T:System.Xml.XmlDocumentType object. More... | |
virtual XmlDocumentFragment | CreateDocumentFragment () |
Creates an T:System.Xml.XmlDocumentFragment. More... | |
XmlElement | CreateElement (string name) |
Creates an element with the specified name. More... | |
virtual XmlEntityReference | CreateEntityReference (string name) |
Creates an T:System.Xml.XmlEntityReference with the specified name. More... | |
virtual XmlProcessingInstruction | CreateProcessingInstruction (string target, string data) |
Creates an T:System.Xml.XmlProcessingInstruction with the specified name and data. More... | |
virtual XmlDeclaration | CreateXmlDeclaration (string version, string encoding, string standalone) |
Creates an T:System.Xml.XmlDeclaration node with the specified values. More... | |
virtual XmlText | CreateTextNode (string text) |
Creates an T:System.Xml.XmlText with the specified text. More... | |
virtual XmlSignificantWhitespace | CreateSignificantWhitespace (string text) |
Creates an T:System.Xml.XmlSignificantWhitespace node. More... | |
override XPathNavigator | CreateNavigator () |
Creates a new T:System.Xml.XPath.XPathNavigator object for navigating this document. More... | |
virtual XmlWhitespace | CreateWhitespace (string text) |
Creates an T:System.Xml.XmlWhitespace node. More... | |
virtual XmlNodeList | GetElementsByTagName (string name) |
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the specified P:System.Xml.XmlDocument.Name. More... | |
XmlAttribute | CreateAttribute (string qualifiedName, string namespaceURI) |
Creates an T:System.Xml.XmlAttribute with the specified qualified name and P:System.Xml.XmlNode.NamespaceURI. More... | |
XmlElement | CreateElement (string qualifiedName, string namespaceURI) |
Creates an T:System.Xml.XmlElement with the qualified name and P:System.Xml.XmlNode.NamespaceURI. More... | |
virtual XmlNodeList | GetElementsByTagName (string localName, string namespaceURI) |
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the specified P:System.Xml.XmlDocument.LocalName and P:System.Xml.XmlNode.NamespaceURI. More... | |
virtual XmlElement | GetElementById (string elementId) |
Gets the T:System.Xml.XmlElement with the specified ID. More... | |
virtual XmlNode | ImportNode (XmlNode node, bool deep) |
Imports a node from another document to the current document. More... | |
virtual XmlAttribute | CreateAttribute (string prefix, string localName, string namespaceURI) |
Creates an T:System.Xml.XmlAttribute with the specified P:System.Xml.XmlNode.Prefix, P:System.Xml.XmlDocument.LocalName, and P:System.Xml.XmlNode.NamespaceURI. More... | |
virtual XmlElement | CreateElement (string prefix, string localName, string namespaceURI) |
Creates an element with the specified P:System.Xml.XmlNode.Prefix, P:System.Xml.XmlDocument.LocalName, and P:System.Xml.XmlNode.NamespaceURI. More... | |
virtual XmlNode | CreateNode (XmlNodeType type, string prefix, string name, string namespaceURI) |
Creates a T:System.Xml.XmlNode with the specified T:System.Xml.XmlNodeType, P:System.Xml.XmlNode.Prefix, P:System.Xml.XmlDocument.Name, and P:System.Xml.XmlNode.NamespaceURI. More... | |
virtual XmlNode | CreateNode (string nodeTypeString, string name, string namespaceURI) |
Creates an T:System.Xml.XmlNode with the specified node type, P:System.Xml.XmlDocument.Name, and P:System.Xml.XmlNode.NamespaceURI. More... | |
virtual XmlNode | CreateNode (XmlNodeType type, string name, string namespaceURI) |
Creates an T:System.Xml.XmlNode with the specified T:System.Xml.XmlNodeType, P:System.Xml.XmlDocument.Name, and P:System.Xml.XmlNode.NamespaceURI. More... | |
virtual XmlNode | ReadNode (XmlReader reader) |
Creates an T:System.Xml.XmlNode object based on the information in the T:System.Xml.XmlReader. The reader must be positioned on a node or attribute. More... | |
virtual void | Load (string filename) |
Loads the XML document from the specified URL. More... | |
virtual void | Load (Stream inStream) |
Loads the XML document from the specified stream. More... | |
virtual void | Load (TextReader txtReader) |
Loads the XML document from the specified T:System.IO.TextReader. More... | |
virtual void | Load (XmlReader reader) |
Loads the XML document from the specified T:System.Xml.XmlReader. More... | |
virtual void | LoadXml (string xml) |
Loads the XML document from the specified string. More... | |
virtual void | Save (string filename) |
Saves the XML document to the specified file. If the specified file exists, this method overwrites it. More... | |
virtual void | Save (Stream outStream) |
Saves the XML document to the specified stream. More... | |
virtual void | Save (TextWriter writer) |
Saves the XML document to the specified T:System.IO.TextWriter. More... | |
virtual void | Save (XmlWriter w) |
Saves the XML document to the specified T:System.Xml.XmlWriter. More... | |
override void | WriteTo (XmlWriter w) |
Saves the XmlDocument node to the specified T:System.Xml.XmlWriter. More... | |
override void | WriteContentTo (XmlWriter xw) |
Saves all the children of the XmlDocument node to the specified T:System.Xml.XmlWriter. More... | |
void | Validate (ValidationEventHandler validationEventHandler) |
Validates the T:System.Xml.XmlDocument against the XML Schema Definition Language (XSD) schemas contained in the P:System.Xml.XmlDocument.Schemas property. More... | |
void | Validate (ValidationEventHandler validationEventHandler, XmlNode nodeToValidate) |
Validates the T:System.Xml.XmlNode object specified against the XML Schema Definition Language (XSD) schemas in the P:System.Xml.XmlDocument.Schemas property. More... | |
![]() | |
XmlNode | SelectSingleNode (string xpath) |
Selects the first XmlNode that matches the XPath expression. More... | |
XmlNode | SelectSingleNode (string xpath, XmlNamespaceManager nsmgr) |
Selects the first XmlNode that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied T:System.Xml.XmlNamespaceManager. More... | |
XmlNodeList | SelectNodes (string xpath) |
Selects a list of nodes matching the XPath expression. More... | |
XmlNodeList | SelectNodes (string xpath, XmlNamespaceManager nsmgr) |
Selects a list of nodes matching the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied T:System.Xml.XmlNamespaceManager. More... | |
virtual XmlNode | InsertBefore (XmlNode newChild, XmlNode refChild) |
Inserts the specified node immediately before the specified reference node. More... | |
virtual XmlNode | InsertAfter (XmlNode newChild, XmlNode refChild) |
Inserts the specified node immediately after the specified reference node. More... | |
virtual XmlNode | ReplaceChild (XmlNode newChild, XmlNode oldChild) |
Replaces the child node oldChild with newChild node. More... | |
virtual XmlNode | RemoveChild (XmlNode oldChild) |
Removes specified child node. More... | |
virtual XmlNode | PrependChild (XmlNode newChild) |
Adds the specified node to the beginning of the list of child nodes for this node. More... | |
virtual XmlNode | AppendChild (XmlNode newChild) |
Adds the specified node to the end of the list of child nodes, of this node. More... | |
virtual void | Normalize () |
Puts all XmlText nodes in the full depth of the sub-tree underneath this XmlNode into a "normal" form where only markup (that is, tags, comments, processing instructions, CDATA sections, and entity references) separates XmlText nodes, that is, there are no adjacent XmlText nodes. More... | |
virtual bool | Supports (string feature, string version) |
Tests if the DOM implementation implements a specific feature. More... | |
virtual XmlNode | Clone () |
Creates a duplicate of this node. More... | |
IEnumerator | GetEnumerator () |
Get an enumerator that iterates through the child nodes in the current node. More... | |
virtual void | RemoveAll () |
Removes all the child nodes and/or attributes of the current node. More... | |
virtual string | GetNamespaceOfPrefix (string prefix) |
Looks up the closest xmlns declaration for the given prefix that is in scope for the current node and returns the namespace URI in the declaration. More... | |
virtual string | GetPrefixOfNamespace (string namespaceURI) |
Looks up the closest xmlns declaration for the given namespace URI that is in scope for the current node and returns the prefix defined in that declaration. More... | |
Public Attributes | |
override XmlNodeType | NodeType => XmlNodeType.Document |
Gets the type of the current node. More... | |
override XmlNode | ParentNode => null |
Gets the parent node of this node (for nodes that can have parents). More... | |
virtual XmlDocumentType | DocumentType => (XmlDocumentType)FindChild(XmlNodeType.DocumentType) |
Gets the node containing the DOCTYPE declaration. More... | |
XmlImplementation | Implementation => implementation |
Gets the T:System.Xml.XmlImplementation object for the current document. More... | |
override string | Name => strDocumentName |
Gets the qualified name of the node. More... | |
override string | LocalName => strDocumentName |
Gets the local name of the node. More... | |
XmlElement | DocumentElement => (XmlElement)FindChild(XmlNodeType.Element) |
Gets the root T:System.Xml.XmlElement for the document. More... | |
override XmlDocument | OwnerDocument => null |
Gets the T:System.Xml.XmlDocument to which the current node belongs. More... | |
XmlNameTable | NameTable => implementation.NameTable |
Gets the T:System.Xml.XmlNameTable associated with this implementation. More... | |
override bool | IsReadOnly => false |
Gets a value indicating whether the current node is read-only. More... | |
override string | BaseURI => baseURI |
Gets the base URI of the current node. More... | |
![]() | |
virtual XmlNodeList | ChildNodes => new XmlChildNodes(this) |
Gets all the child nodes of the node. More... | |
virtual XmlNode | PreviousSibling => null |
Gets the node immediately preceding this node. More... | |
virtual XmlNode | NextSibling => null |
Gets the node immediately following this node. More... | |
virtual XmlAttributeCollection | Attributes => null |
Gets an T:System.Xml.XmlAttributeCollection containing the attributes of this node. More... | |
virtual XmlNode | FirstChild => LastNode?.next |
Gets the first child of the node. More... | |
virtual XmlNode | LastChild => LastNode |
Gets the last child of the node. More... | |
virtual bool | HasChildNodes => LastNode != null |
Gets a value indicating whether this node has any child nodes. More... | |
virtual string | NamespaceURI => string.Empty |
Gets the namespace URI of this node. More... | |
virtual IXmlSchemaInfo | SchemaInfo => XmlDocument.NotKnownSchemaInfo |
Gets the post schema validation infoset that has been assigned to this node as a result of schema validation. More... | |
virtual XmlNode | PreviousText => null |
Gets the text node that immediately precedes this node. More... | |
Protected Member Functions | |
internal | XmlDocument (XmlImplementation imp) |
Initializes a new instance of the XmlDocument class with the specified T:System.Xml.XmlImplementation. More... | |
virtual internal XPathNavigator | CreateNavigator (XmlNode node) |
Creates an T:System.Xml.XPath.XPathNavigator object for navigating this document positioned on the T:System.Xml.XmlNode specified. More... | |
virtual internal XmlAttribute | CreateDefaultAttribute (string prefix, string localName, string namespaceURI) |
Creates a default attribute with the specified prefix, local name and namespace URI. More... | |
Properties | |
XmlSchemaSet | Schemas [get, set] |
Gets or sets the T:System.Xml.Schema.XmlSchemaSet object associated with this T:System.Xml.XmlDocument. More... | |
virtual XmlResolver | XmlResolver [set] |
Sets the T:System.Xml.XmlResolver to use for resolving external resources. More... | |
bool | PreserveWhitespace [get, set] |
Gets or sets a value indicating whether to preserve white space in element content. More... | |
override string | InnerText [set] |
Throws an T:System.InvalidOperationException in all cases. More... | |
override string | InnerXml [get, set] |
Gets or sets the markup representing the children of the current node. More... | |
override IXmlSchemaInfo | SchemaInfo [get] |
Returns the Post-Schema-Validation-Infoset (PSVI) of the node. More... | |
XmlNodeChangedEventHandler | NodeInserting |
Occurs when a node belonging to this document is about to be inserted into another node. More... | |
XmlNodeChangedEventHandler | NodeInserted |
Occurs when a node belonging to this document has been inserted into another node. More... | |
XmlNodeChangedEventHandler | NodeRemoving |
Occurs when a node belonging to this document is about to be removed from the document. More... | |
XmlNodeChangedEventHandler | NodeRemoved |
Occurs when a node belonging to this document has been removed from its parent. More... | |
XmlNodeChangedEventHandler | NodeChanging |
Occurs when the P:System.Xml.XmlNode.Value of a node belonging to this document is about to be changed. More... | |
XmlNodeChangedEventHandler | NodeChanged |
Occurs when the P:System.Xml.XmlNode.Value of a node belonging to this document has been changed. More... | |
![]() | |
abstract string | Name [get] |
Gets the qualified name of the node, when overridden in a derived class. More... | |
virtual string | Value [get, set] |
Gets or sets the value of the node. More... | |
abstract XmlNodeType | NodeType [get] |
Gets the type of the current node, when overridden in a derived class. More... | |
virtual XmlNode | ParentNode [get] |
Gets the parent of this node (for nodes that can have parents). More... | |
virtual XmlDocument | OwnerDocument [get] |
Gets the T:System.Xml.XmlDocument to which this node belongs. More... | |
virtual string | Prefix [get, set] |
Gets or sets the namespace prefix of this node. More... | |
abstract string | LocalName [get] |
Gets the local name of the node, when overridden in a derived class. More... | |
virtual bool | IsReadOnly [get] |
Gets a value indicating whether the node is read-only. More... | |
virtual string | InnerText [get, set] |
Gets or sets the concatenated values of the node and all its child nodes. More... | |
virtual string | OuterXml [get] |
Gets the markup containing this node and all its child nodes. More... | |
virtual string | InnerXml [get, set] |
Gets or sets the markup representing only the child nodes of this node. More... | |
virtual string | BaseURI [get] |
Gets the base URI of the current node. More... | |
virtual XmlElement | this[string name] [get] |
Gets the first child element with the specified P:System.Xml.XmlNode.Name. More... | |
virtual XmlElement | this[string localname, string ns] [get] |
Gets the first child element with the specified P:System.Xml.XmlNode.LocalName and P:System.Xml.XmlNode.NamespaceURI. More... | |
Represents an XML document. You can use this class to load, validate, edit, add, and position XML in a document.
Definition at line 13 of file XmlDocument.cs.
System.Xml.XmlDocument.XmlDocument | ( | ) |
Initializes a new instance of the T:System.Xml.XmlDocument class.
Definition at line 465 of file XmlDocument.cs.
System.Xml.XmlDocument.XmlDocument | ( | XmlNameTable | nt | ) |
Initializes a new instance of the XmlDocument
class with the specified T:System.Xml.XmlNameTable.
nt | The XmlNameTable to use. |
Definition at line 472 of file XmlDocument.cs.
|
protected |
Initializes a new instance of the XmlDocument
class with the specified T:System.Xml.XmlImplementation.
imp | The XmlImplementation to use. |
Definition at line 479 of file XmlDocument.cs.
|
virtual |
Creates a duplicate of this node.
deep | true to recursively clone the subtree under the specified node; false to clone only the node itself. |
XmlDocument
node.Implements System.Xml.XmlNode.
Definition at line 638 of file XmlDocument.cs.
XmlAttribute System.Xml.XmlDocument.CreateAttribute | ( | string | name | ) |
Creates an T:System.Xml.XmlAttribute with the specified P:System.Xml.XmlDocument.Name.
name | The qualified name of the attribute. If the name contains a colon, the P:System.Xml.XmlNode.Prefix property reflects the part of the name preceding the first colon and the P:System.Xml.XmlDocument.LocalName property reflects the part of the name following the first colon. The P:System.Xml.XmlNode.NamespaceURI remains empty unless the prefix is a recognized built-in prefix such as xmlns. In this case NamespaceURI has a value of http://www.w3.org/2000/xmlns/. |
XmlAttribute
.Definition at line 786 of file XmlDocument.cs.
XmlAttribute System.Xml.XmlDocument.CreateAttribute | ( | string | qualifiedName, |
string | namespaceURI | ||
) |
Creates an T:System.Xml.XmlAttribute with the specified qualified name and P:System.Xml.XmlNode.NamespaceURI.
qualifiedName | The qualified name of the attribute. If the name contains a colon then the P:System.Xml.XmlNode.Prefix property will reflect the part of the name preceding the colon and the P:System.Xml.XmlDocument.LocalName property will reflect the part of the name after the colon. |
namespaceURI | The namespaceURI of the attribute. If the qualified name includes a prefix of xmlns, then this parameter must be http://www.w3.org/2000/xmlns/. |
XmlAttribute
.Definition at line 1098 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlAttribute with the specified P:System.Xml.XmlNode.Prefix, P:System.Xml.XmlDocument.LocalName, and P:System.Xml.XmlNode.NamespaceURI.
prefix | The prefix of the attribute (if any). String.Empty and null are equivalent. |
localName | The local name of the attribute. |
namespaceURI | The namespace URI of the attribute (if any). String.Empty and null are equivalent. If prefix is xmlns, then this parameter must be http://www.w3.org/2000/xmlns/; otherwise an exception is thrown. |
XmlAttribute
.Reimplemented in System.Configuration.ConfigXmlDocument.
Definition at line 1256 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlCDataSection containing the specified data.
data | The content of the new XmlCDataSection . |
XmlCDataSection
.Reimplemented in System.Configuration.ConfigXmlDocument.
Definition at line 811 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlComment containing the specified data.
data | The content of the new XmlComment . |
XmlComment
.Reimplemented in System.Configuration.ConfigXmlDocument.
Definition at line 820 of file XmlDocument.cs.
|
protectedvirtual |
Creates a default attribute with the specified prefix, local name and namespace URI.
prefix | The prefix of the attribute (if any). |
localName | The local name of the attribute. |
namespaceURI | The namespace URI of the attribute (if any). |
Definition at line 1266 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlDocumentFragment.
XmlDocumentFragment
.Definition at line 839 of file XmlDocument.cs.
|
virtual |
Returns a new T:System.Xml.XmlDocumentType object.
name | Name of the document type. |
publicId | The public identifier of the document type or null . You can specify a public URI and also a system identifier to identify the location of the external DTD subset. |
systemId | The system identifier of the document type or null . Specifies the URL of the file location for the external DTD subset. |
internalSubset | The DTD internal subset of the document type or null . |
XmlDocumentType
.Definition at line 832 of file XmlDocument.cs.
XmlElement System.Xml.XmlDocument.CreateElement | ( | string | name | ) |
Creates an element with the specified name.
name | The qualified name of the element. If the name contains a colon then the P:System.Xml.XmlNode.Prefix property reflects the part of the name preceding the colon and the P:System.Xml.XmlDocument.LocalName property reflects the part of the name after the colon. The qualified name cannot include a prefix of'xmlns'. |
XmlElement
.Definition at line 847 of file XmlDocument.cs.
XmlElement System.Xml.XmlDocument.CreateElement | ( | string | qualifiedName, |
string | namespaceURI | ||
) |
Creates an T:System.Xml.XmlElement with the qualified name and P:System.Xml.XmlNode.NamespaceURI.
qualifiedName | The qualified name of the element. If the name contains a colon then the P:System.Xml.XmlNode.Prefix property will reflect the part of the name preceding the colon and the P:System.Xml.XmlDocument.LocalName property will reflect the part of the name after the colon. The qualified name cannot include a prefix of'xmlns'. |
namespaceURI | The namespace URI of the element. |
XmlElement
.Definition at line 1110 of file XmlDocument.cs.
|
virtual |
Creates an element with the specified P:System.Xml.XmlNode.Prefix, P:System.Xml.XmlDocument.LocalName, and P:System.Xml.XmlNode.NamespaceURI.
prefix | The prefix of the new element (if any). String.Empty and null are equivalent. |
localName | The local name of the new element. |
namespaceURI | The namespace URI of the new element (if any). String.Empty and null are equivalent. |
Reimplemented in System.Configuration.ConfigXmlDocument.
Definition at line 1276 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlEntityReference with the specified name.
name | The name of the entity reference. |
XmlEntityReference
.T:System.ArgumentException | The name is invalid (for example, names starting with'#' are invalid.) |
Definition at line 914 of file XmlDocument.cs.
|
virtual |
Creates a new T:System.Xml.XPath.XPathNavigator object for navigating this document.
Reimplemented from System.Xml.XmlNode.
Definition at line 957 of file XmlDocument.cs.
|
protectedvirtual |
Creates an T:System.Xml.XPath.XPathNavigator object for navigating this document positioned on the T:System.Xml.XmlNode specified.
node | The T:System.Xml.XmlNode you want the navigator initially positioned on. |
Definition at line 965 of file XmlDocument.cs.
|
virtual |
Creates a T:System.Xml.XmlNode with the specified T:System.Xml.XmlNodeType, P:System.Xml.XmlNode.Prefix, P:System.Xml.XmlDocument.Name, and P:System.Xml.XmlNode.NamespaceURI.
type | The XmlNodeType of the new node. |
prefix | The prefix of the new node. |
name | The local name of the new node. |
namespaceURI | The namespace URI of the new node. |
XmlNode
.T:System.ArgumentException | The name was not provided and the XmlNodeType requires a name. |
Definition at line 1293 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlNode with the specified node type, P:System.Xml.XmlDocument.Name, and P:System.Xml.XmlNode.NamespaceURI.
nodeTypeString | String version of the T:System.Xml.XmlNodeType of the new node. This parameter must be one of the values listed in the table below. |
name | The qualified name of the new node. If the name contains a colon, it is parsed into P:System.Xml.XmlNode.Prefix and P:System.Xml.XmlDocument.LocalName components. |
namespaceURI | The namespace URI of the new node. |
XmlNode
.T:System.ArgumentException | The name was not provided and the XmlNodeType requires a name; or nodeTypeString is not one of the strings listed below. |
Definition at line 1342 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlNode with the specified T:System.Xml.XmlNodeType, P:System.Xml.XmlDocument.Name, and P:System.Xml.XmlNode.NamespaceURI.
type | The XmlNodeType of the new node. |
name | The qualified name of the new node. If the name contains a colon then it is parsed into P:System.Xml.XmlNode.Prefix and P:System.Xml.XmlDocument.LocalName components. |
namespaceURI | The namespace URI of the new node. |
XmlNode
.T:System.ArgumentException | The name was not provided and the XmlNodeType requires a name. |
Definition at line 1353 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlProcessingInstruction with the specified name and data.
target | The name of the processing instruction. |
data | The data for the processing instruction. |
XmlProcessingInstruction
.Definition at line 923 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlSignificantWhitespace node.
text | The string must contain only the following characters  and 	 |
XmlSignificantWhitespace
node.Reimplemented in System.Configuration.ConfigXmlDocument.
Definition at line 950 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlText with the specified text.
text | The text for the Text node. |
XmlText
node.Reimplemented in System.Configuration.ConfigXmlDocument.
Definition at line 942 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlWhitespace node.
text | The string must contain only the following characters  and 	 |
XmlWhitespace
node.Reimplemented in System.Configuration.ConfigXmlDocument.
Definition at line 1081 of file XmlDocument.cs.
|
virtual |
Creates an T:System.Xml.XmlDeclaration node with the specified values.
version | The version must be "1.0". |
encoding | The value of the encoding attribute. This is the encoding that is used when you save the T:System.Xml.XmlDocument to a file or a stream; therefore, it must be set to a string supported by the T:System.Text.Encoding class, otherwise M:System.Xml.XmlDocument.Save(System.String) fails. If this is null or String.Empty, the Save method does not write an encoding attribute on the XML declaration and therefore the default encoding, UTF-8, is used.Note: If the XmlDocument is saved to either a T:System.IO.TextWriter or an T:System.Xml.XmlTextWriter, this encoding value is discarded. Instead, the encoding of the TextWriter or the XmlTextWriter is used. This ensures that the XML written out can be read back using the correct encoding. |
standalone | The value must be either "yes" or "no". If this is null or String.Empty, the Save method does not write a standalone attribute on the XML declaration. |
XmlDeclaration
node.T:System.ArgumentException | The values of version or standalone are something other than the ones specified above. |
Definition at line 934 of file XmlDocument.cs.
|
virtual |
Gets the T:System.Xml.XmlElement with the specified ID.
elementId | The attribute ID to match. |
XmlElement
with the matching ID or null
if no matching element is found.Definition at line 1130 of file XmlDocument.cs.
|
virtual |
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the specified P:System.Xml.XmlDocument.Name.
name | The qualified name to match. It is matched against the Name property of the matching node. The special value "*" matches all tags. |
Definition at line 1089 of file XmlDocument.cs.
|
virtual |
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the specified P:System.Xml.XmlDocument.LocalName and P:System.Xml.XmlNode.NamespaceURI.
localName | The LocalName to match. The special value "*" matches all tags. |
namespaceURI | NamespaceURI to match. |
Definition at line 1122 of file XmlDocument.cs.
Imports a node from another document to the current document.
node | The node being imported. |
deep | true to perform a deep clone; otherwise, false . |
T:System.InvalidOperationException | Calling this method on a node type which cannot be imported. |
Definition at line 1156 of file XmlDocument.cs.
|
virtual |
Loads the XML document from the specified URL.
filename | URL for the file containing the XML document to load. The URL can be either a local file or an HTTP URL (a Web address). |
T:System.Xml.XmlException | There is a load or parse error in the XML. In this case, a T:System.IO.FileNotFoundException is raised. |
T:System.ArgumentException | filename is a zero-length string, contains only white space, or contains one or more invalid characters as defined by F:System.IO.Path.InvalidPathChars. |
T:System.ArgumentNullException | filename is null . |
T:System.IO.PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. |
T:System.IO.DirectoryNotFoundException | The specified path is invalid (for example, it is on an unmapped drive). |
T:System.IO.IOException | An I/O error occurred while opening the file. |
T:System.UnauthorizedAccessException | filename specified a file that is read-only.-or- This operation is not supported on the current platform.-or- filename specified a directory.-or- The caller does not have the required permission. |
T:System.IO.FileNotFoundException | The file specified in filename was not found. |
T:System.NotSupportedException | filename is in an invalid format. |
T:System.Security.SecurityException | The caller does not have the required permission. |
Reimplemented in System.Configuration.ConfigXmlDocument.
Definition at line 1467 of file XmlDocument.cs.
|
virtual |
Loads the XML document from the specified stream.
inStream | The stream containing the XML document to load. |
T:System.Xml.XmlException | There is a load or parse error in the XML. In this case, a T:System.IO.FileNotFoundException is raised. |
Definition at line 1483 of file XmlDocument.cs.
|
virtual |
Loads the XML document from the specified T:System.IO.TextReader.
txtReader | The TextReader used to feed the XML data into the document. |
T:System.Xml.XmlException | There is a load or parse error in the XML. In this case, the document remains empty. |
Definition at line 1499 of file XmlDocument.cs.
|
virtual |
Loads the XML document from the specified T:System.Xml.XmlReader.
reader | The XmlReader used to feed the XML data into the document. |
T:System.Xml.XmlException | There is a load or parse error in the XML. In this case, the document remains empty. |
Definition at line 1515 of file XmlDocument.cs.
|
virtual |
Loads the XML document from the specified string.
xml | String containing the XML document to load. |
T:System.Xml.XmlException | There is a load or parse error in the XML. In this case, the document remains empty. |
Definition at line 1539 of file XmlDocument.cs.
Creates an T:System.Xml.XmlNode object based on the information in the T:System.Xml.XmlReader. The reader must be positioned on a node or attribute.
reader | The XML source |
XmlNode
or null
if no more nodes exist.T:System.NullReferenceException | The reader is positioned on a node type that does not translate to a valid DOM node (for example, EndElement or EndEntity). |
Definition at line 1363 of file XmlDocument.cs.
|
virtual |
Saves the XML document to the specified file. If the specified file exists, this method overwrites it.
filename | The location of the file where you want to save the document. |
T:System.Xml.XmlException | The operation would not result in a well formed XML document (for example, no document element or duplicate XML declarations). |
Definition at line 1555 of file XmlDocument.cs.
|
virtual |
Saves the XML document to the specified stream.
outStream | The stream to which you want to save. |
T:System.Xml.XmlException | The operation would not result in a well formed XML document (for example, no document element or duplicate XML declarations). |
Definition at line 1580 of file XmlDocument.cs.
|
virtual |
Saves the XML document to the specified T:System.IO.TextWriter.
writer | The TextWriter to which you want to save. |
T:System.Xml.XmlException | The operation would not result in a well formed XML document (for example, no document element or duplicate XML declarations). |
Definition at line 1594 of file XmlDocument.cs.
|
virtual |
Saves the XML document to the specified T:System.Xml.XmlWriter.
w | The XmlWriter to which you want to save. |
T:System.Xml.XmlException | The operation would not result in a well formed XML document (for example, no document element or duplicate XML declarations). |
Definition at line 1607 of file XmlDocument.cs.
void System.Xml.XmlDocument.Validate | ( | ValidationEventHandler | validationEventHandler | ) |
Validates the T:System.Xml.XmlDocument against the XML Schema Definition Language (XSD) schemas contained in the P:System.Xml.XmlDocument.Schemas property.
validationEventHandler | The T:System.Xml.Schema.ValidationEventHandler object that receives information about schema validation warnings and errors. |
T:System.Xml.Schema.XmlSchemaValidationException | A schema validation event occurred and no T:System.Xml.Schema.ValidationEventHandler object was specified. |
Definition at line 1678 of file XmlDocument.cs.
void System.Xml.XmlDocument.Validate | ( | ValidationEventHandler | validationEventHandler, |
XmlNode | nodeToValidate | ||
) |
Validates the T:System.Xml.XmlNode object specified against the XML Schema Definition Language (XSD) schemas in the P:System.Xml.XmlDocument.Schemas property.
validationEventHandler | The T:System.Xml.Schema.ValidationEventHandler object that receives information about schema validation warnings and errors. |
nodeToValidate | The T:System.Xml.XmlNode object created from an T:System.Xml.XmlDocument to validate. |
T:System.ArgumentException | The T:System.Xml.XmlNode object parameter was not created from an T:System.Xml.XmlDocument. |
T:System.InvalidOperationException | The T:System.Xml.XmlNode object parameter is not an element, attribute, document fragment, or the root node. |
T:System.Xml.Schema.XmlSchemaValidationException | A schema validation event occurred and no T:System.Xml.Schema.ValidationEventHandler object was specified. |
Definition at line 1689 of file XmlDocument.cs.
|
virtual |
Saves all the children of the XmlDocument
node to the specified T:System.Xml.XmlWriter.
xw | The XmlWriter to which you want to save. |
Implements System.Xml.XmlNode.
Definition at line 1654 of file XmlDocument.cs.
|
virtual |
Saves the XmlDocument
node to the specified T:System.Xml.XmlWriter.
w | The XmlWriter to which you want to save. |
Implements System.Xml.XmlNode.
Definition at line 1647 of file XmlDocument.cs.
override string System.Xml.XmlDocument.BaseURI => baseURI |
Gets the base URI of the current node.
Definition at line 367 of file XmlDocument.cs.
XmlElement System.Xml.XmlDocument.DocumentElement => (XmlElement)FindChild(XmlNodeType.Element) |
Gets the root T:System.Xml.XmlElement for the document.
XmlElement
that represents the root of the XML document tree. If no root exists, null
is returned.Definition at line 155 of file XmlDocument.cs.
virtual XmlDocumentType System.Xml.XmlDocument.DocumentType => (XmlDocumentType)FindChild(XmlNodeType.DocumentType) |
Gets the node containing the DOCTYPE declaration.
Definition at line 127 of file XmlDocument.cs.
XmlImplementation System.Xml.XmlDocument.Implementation => implementation |
Gets the T:System.Xml.XmlImplementation object for the current document.
XmlImplementation
object for the current document.Definition at line 143 of file XmlDocument.cs.
override bool System.Xml.XmlDocument.IsReadOnly => false |
Gets a value indicating whether the current node is read-only.
true
if the current node is read-only; otherwise false
. XmlDocument
nodes always return false
.Definition at line 250 of file XmlDocument.cs.
override string System.Xml.XmlDocument.LocalName => strDocumentName |
Gets the local name of the node.
XmlDocument
nodes, the local name is #document.Definition at line 151 of file XmlDocument.cs.
override string System.Xml.XmlDocument.Name => strDocumentName |
Gets the qualified name of the node.
XmlDocument
nodes, the name is #document.Definition at line 147 of file XmlDocument.cs.
XmlNameTable System.Xml.XmlDocument.NameTable => implementation.NameTable |
Gets the T:System.Xml.XmlNameTable associated with this implementation.
XmlNameTable
enabling you to get the atomized version of a string within the document.Definition at line 230 of file XmlDocument.cs.
override XmlNodeType System.Xml.XmlDocument.NodeType => XmlNodeType.Document |
Gets the type of the current node.
XmlDocument
nodes, this value is XmlNodeType.Document.Definition at line 119 of file XmlDocument.cs.
override XmlDocument System.Xml.XmlDocument.OwnerDocument => null |
Gets the T:System.Xml.XmlDocument to which the current node belongs.
XmlDocument
nodes (P:System.Xml.XmlDocument.NodeType equals XmlNodeType.Document), this property always returns null
.Definition at line 173 of file XmlDocument.cs.
override XmlNode System.Xml.XmlDocument.ParentNode => null |
Gets the parent node of this node (for nodes that can have parents).
null
.Definition at line 123 of file XmlDocument.cs.
|
set |
Throws an T:System.InvalidOperationException in all cases.
T:System.InvalidOperationException | In all cases. |
Definition at line 313 of file XmlDocument.cs.
|
getset |
Gets or sets the markup representing the children of the current node.
T:System.Xml.XmlException | The XML specified when setting this property is not well-formed. |
Definition at line 324 of file XmlDocument.cs.
|
addremove |
Occurs when the P:System.Xml.XmlNode.Value of a node belonging to this document has been changed.
Definition at line 453 of file XmlDocument.cs.
|
addremove |
Occurs when the P:System.Xml.XmlNode.Value of a node belonging to this document is about to be changed.
Definition at line 440 of file XmlDocument.cs.
|
addremove |
Occurs when a node belonging to this document has been inserted into another node.
Definition at line 401 of file XmlDocument.cs.
|
addremove |
Occurs when a node belonging to this document is about to be inserted into another node.
Definition at line 388 of file XmlDocument.cs.
|
addremove |
Occurs when a node belonging to this document has been removed from its parent.
Definition at line 427 of file XmlDocument.cs.
|
addremove |
Occurs when a node belonging to this document is about to be removed from the document.
Definition at line 414 of file XmlDocument.cs.
|
getset |
Gets or sets a value indicating whether to preserve white space in element content.
true
to preserve white space; otherwise false
. The default is false
.Definition at line 236 of file XmlDocument.cs.
|
get |
Returns the Post-Schema-Validation-Infoset (PSVI) of the node.
Definition at line 344 of file XmlDocument.cs.
|
getset |
Gets or sets the T:System.Xml.Schema.XmlSchemaSet object associated with this T:System.Xml.XmlDocument.
Definition at line 178 of file XmlDocument.cs.
|
set |
Sets the T:System.Xml.XmlResolver to use for resolving external resources.
XmlResolver
to use.In version 1.1 of the.NET Framework, the caller must be fully trusted in order to specify an XmlResolver
.T:System.Xml.XmlException | This property is set to null and an external DTD or entity is encountered. |
Definition at line 201 of file XmlDocument.cs.