15 internal XmlName XmlName
29 public override string Name => name.Name;
43 public override string Prefix 67 internal override bool IsContainer =>
true;
75 return lastChild ==
this;
81 if (lastChild !=
this)
87 else if (lastChild ==
this)
98 if (lastChild !=
this)
113 public override XmlAttributeCollection
Attributes 117 if (attributes ==
null)
121 if (attributes ==
null)
138 if (attributes ==
null)
142 return attributes.Count > 0;
157 return base.InnerXml;
162 XmlLoader xmlLoader =
new XmlLoader();
163 xmlLoader.LoadInnerXmlElement(
this, value);
173 return base.InnerText;
178 if (lastNode !=
null && lastNode.
NodeType ==
XmlNodeType.Text && lastNode.next == lastNode)
180 lastNode.
Value = value;
194 if (parentNode !=
null && parentNode.LastNode !=
this)
204 internal override string XPLocalName =>
LocalName;
215 if (name.LocalName.Length == 0)
232 : this(doc.AddXmlName(prefix, localName, namespaceURI, null), empty: true, doc)
243 bool isLoading = ownerDocument.IsLoading;
244 ownerDocument.IsLoading =
true;
246 ownerDocument.IsLoading = isLoading;
256 if (attribute is XmlUnspecifiedAttribute && !attribute.
Specified)
258 ((XmlUnspecifiedAttribute)xmlAttribute2).SetSpecified(f:
false);
260 xmlElement.
Attributes.InternalAppendAttribute(xmlAttribute2);
265 xmlElement.CopyChildren(ownerDocument,
this, deep);
273 if (insertEventArgsForLoad !=
null)
275 doc.BeforeEvent(insertEventArgsForLoad);
277 XmlLinkedNode xmlLinkedNode = (XmlLinkedNode)newChild;
278 if (lastChild ==
null || lastChild ==
this)
280 xmlLinkedNode.next = xmlLinkedNode;
281 lastChild = xmlLinkedNode;
282 xmlLinkedNode.SetParentForLoad(
this);
286 XmlLinkedNode xmlLinkedNode2 = lastChild;
287 xmlLinkedNode.next = xmlLinkedNode2.next;
288 xmlLinkedNode2.next = xmlLinkedNode;
289 lastChild = xmlLinkedNode;
290 if (xmlLinkedNode2.IsText && xmlLinkedNode.IsText)
292 XmlNode.NestTextNodes(xmlLinkedNode2, xmlLinkedNode);
296 xmlLinkedNode.SetParentForLoad(
this);
299 if (insertEventArgsForLoad !=
null)
301 doc.AfterEvent(insertEventArgsForLoad);
303 return xmlLinkedNode;
306 internal override bool IsValidChildType(
XmlNodeType type)
330 if (attributeNode !=
null)
332 return attributeNode.
Value;
345 if (attributeNode ==
null)
348 attributeNode.
Value = value;
349 Attributes.InternalAppendAttribute(attributeNode);
353 attributeNode.
Value = value;
412 return new XmlElementList(
this, name);
419 public virtual string GetAttribute(
string localName,
string namespaceURI)
422 if (attributeNode !=
null)
424 return attributeNode.
Value;
434 public virtual string SetAttribute(
string localName,
string namespaceURI,
string value)
437 if (attributeNode ==
null)
440 attributeNode.
Value = value;
441 Attributes.InternalAppendAttribute(attributeNode);
445 attributeNode.
Value = value;
479 if (xmlAttribute ==
null)
482 Attributes.InternalAppendAttribute(xmlAttribute);
498 return attributeNode;
509 return new XmlElementList(
this, localName, namespaceURI);
526 public virtual bool HasAttribute(
string localName,
string namespaceURI)
537 WriteElementTo(w,
this);
540 WriteStartElement(w);
557 if (e !=
null && e.GetType() == typeof(
XmlElement))
559 e.WriteStartElement(writer);
566 if (e.lastChild !=
null)
583 if (xmlNode2 != xmlNode)
592 private void WriteStartElement(XmlWriter w)
597 XmlAttributeCollection xmlAttributeCollection =
Attributes;
598 for (
int i = 0; i < xmlAttributeCollection.Count; i++)
600 XmlAttribute xmlAttribute = xmlAttributeCollection[i];
601 xmlAttribute.WriteTo(w);
644 internal void RemoveAllChildren()
649 internal override void SetParent(XmlNode node)
654 internal override string GetXPAttribute(
string localName,
string ns)
661 if (attributeNode !=
null)
663 return attributeNode.Value;
virtual XmlAttribute GetAttributeNode(string localName, string namespaceURI)
Returns the T:System.Xml.XmlAttribute with the specified local name and namespace URI.
Represents an XML document. You can use this class to load, validate, edit, add, and position XML in ...
virtual string GetAttribute(string localName, string namespaceURI)
Returns the value for the attribute with the specified local name and namespace URI.
XmlAttribute Remove(XmlAttribute node)
Removes the specified attribute from the collection.
virtual void RemoveAllAttributes()
Removes all specified attributes from the element. Default attributes are not removed.
override void RemoveAll()
Removes all specified attributes and children of the current node. Default attributes are not removed...
Defines the post-schema-validation infoset of a validated XML node.
virtual XmlNode ParentNode
Gets the parent of this node (for nodes that can have parents).
Represents an ordered collection of nodes.
override string LocalName
Gets the local name of the current node.
abstract void WriteTo(XmlWriter w)
Saves the current node to the specified T:System.Xml.XmlWriter, when overridden in a derived class.
virtual bool HasAttribute(string localName, string namespaceURI)
Determines whether the current node has an attribute with the specified local name and namespace URI.
virtual XmlAttribute GetAttributeNode(string name)
Returns the XmlAttribute with the specified name.
XmlElement CreateElement(string name)
Creates an element with the specified name.
virtual XmlNode LastChild
Gets the last child of the node.
virtual XmlNodeList GetElementsByTagName(string name)
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the speci...
Represents an attribute. Valid and default values for the attribute are defined in a document type de...
override XmlNode CloneNode(bool deep)
Creates a duplicate of this node.
virtual XmlAttribute RemoveAttributeNode(XmlAttribute oldAttr)
Removes the specified T:System.Xml.XmlAttribute.
override string InnerXml
Gets or sets the markup representing just the children of this node.
bool IsEmpty
Gets or sets the tag format of the element.
XmlNodeType
Specifies the type of node.
override string Name
Gets the qualified name of the node.
override XmlNode CloneNode(bool deep)
Creates a duplicate of this node.
XPathNodeType
Defines the XPath node types that can be returned from the T:System.Xml.XPath.XPathNavigator class.
Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files t...
virtual string GetAttribute(string name)
Returns the value for the attribute with the specified name.
Provides data for the E:System.Xml.XmlDocument.NodeChanged, E:System.Xml.XmlDocument....
virtual XmlText CreateTextNode(string text)
Creates an T:System.Xml.XmlText with the specified text.
virtual void RemoveAttribute(string localName, string namespaceURI)
Removes an attribute with the specified local name and namespace URI. (If the removed attribute has a...
virtual bool HasAttribute(string name)
Determines whether the current node has an attribute with the specified name.
virtual bool Specified
Gets a value indicating whether the attribute value was explicitly set.
override string InnerText
Gets or sets the concatenated values of the node and all its children.
abstract void WriteFullEndElement()
When overridden in a derived class, closes one element and pops the corresponding namespace scope.
Gets the node immediately preceding or following this node.
override XmlNode SetNamedItem(XmlNode node)
Adds a T:System.Xml.XmlNode using its P:System.Xml.XmlNode.Name property
virtual string Value
Gets or sets the value of the node.
virtual bool HasAttributes
Gets a boolean value indicating whether the current node has any attributes.
override void WriteTo(XmlWriter w)
Saves the current node to the specified T:System.Xml.XmlWriter.
override XmlNodeType NodeType
Gets the type of the current node.
XmlAttribute CreateAttribute(string name)
Creates an T:System.Xml.XmlAttribute with the specified P:System.Xml.XmlDocument.Name.
abstract void WriteEndElement()
When overridden in a derived class, closes one element and pops the corresponding namespace scope.
internal XmlElement(string prefix, string localName, string namespaceURI, XmlDocument doc)
Initializes a new instance of the T:System.Xml.XmlElement class.
override IXmlSchemaInfo SchemaInfo
Gets the post schema validation infoset that has been assigned to this node as a result of schema val...
virtual void RemoveAttribute(string name)
Removes an attribute by name.
The exception that is thrown when one of the arguments provided to a method is not valid.
virtual string SetAttribute(string localName, string namespaceURI, string value)
Sets the value of the attribute with the specified local name and namespace URI.
override string NamespaceURI
Gets the namespace URI of this node.
virtual XmlAttribute SetAttributeNode(XmlAttribute newAttr)
Adds the specified T:System.Xml.XmlAttribute.
virtual XmlElement OwnerElement
Gets the T:System.Xml.XmlElement to which the attribute belongs.
void RemoveAll()
Removes all attributes from the collection.
virtual XmlNodeList GetElementsByTagName(string localName, string namespaceURI)
Returns an T:System.Xml.XmlNodeList containing a list of all descendant elements that match the speci...
virtual XmlNode RemoveAttributeAt(int i)
Removes the attribute node with the specified index from the element. (If the removed attribute has a...
virtual void SetAttribute(string name, string value)
Sets the value of the attribute with the specified name.
virtual XmlNode FirstChild
Gets the first child of the node.
override string Prefix
Gets or sets the namespace prefix of this node.
virtual XmlNode AppendChild(XmlNode newChild)
Adds the specified node to the end of the list of child nodes, of this node.
Represents a collection of attributes that can be accessed by name or index.
The exception that is thrown when a method call is invalid for the object's current state.
override XmlDocument OwnerDocument
Gets the T:System.Xml.XmlDocument to which this node belongs.
virtual XmlNode NextSibling
Gets the node immediately following this node.
virtual XmlAttribute RemoveAttributeNode(string localName, string namespaceURI)
Removes the T:System.Xml.XmlAttribute specified by the local name and namespace URI....
XmlAttribute RemoveAt(int i)
Removes the attribute corresponding to the specified index from the collection.
override void WriteContentTo(XmlWriter w)
Saves all the children of the node to the specified T:System.Xml.XmlWriter.
override XmlNode ParentNode
Gets the parent of this node (for nodes that can have parents).
override string Value
Gets or sets the value of the node.
override XmlAttributeCollection Attributes
Gets an T:System.Xml.XmlAttributeCollection containing the list of attributes for this node.
Represents a single node in the XML document.
override XmlNode NextSibling
Gets the T:System.Xml.XmlNode immediately following this element.
abstract XmlNodeType NodeType
Gets the type of the current node, when overridden in a derived class.
virtual XmlAttribute SetAttributeNode(string localName, string namespaceURI)
Adds the specified T:System.Xml.XmlAttribute.
virtual XmlNode RemoveNamedItem(string name)
Removes the node from the XmlNamedNodeMap.