XmlAttribute class

XmlAttribute class

Represents an attribute of an XmlElement. Valid and default values for the attribute are defined in a document type definition (DTD) or schema.

Syntax


var xmlAttribute = XmlDocument.createAttribute();
var xmlAttribute = XmlDocument.createAttributeNS();

Members

The XmlAttribute class has these types of members:

Methods

The XmlAttribute class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
AppendChild This method is not applicable to this class and will throw an exception.
CloneNode Clones a new node.
GetXml Returns the XML representation of the node and all its descendants.
HasChildNodes Determines whether a node has children.
InsertBefore Inserts a child node to the left of the specified node, or at the end of the child node list.
Normalize This method is not applicable to this class and will throw an exception.
RemoveChild Removes the specified child node from the list of children and returns it.
ReplaceChild Replaces the specified old child node with the supplied new child node.
SelectNodes Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList.
SelectNodesNS Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList.
SelectSingleNode Applies the specified pattern-matching operation to this node's context and returns the first matching node.
SelectSingleNodeNS Applies the specified pattern-matching operation to this node's context and returns the first matching node.

 

Properties

The XmlAttribute class has these properties.

PropertyAccess typeDescription

Attributes

Read-only

This method is not applicable to this class and will throw an exception.

ChildNodes

Read-only

Gets a list of children in the current node.

FirstChild

Read-only

Gets the first child node.

InnerText

Read/write

Gets the text from inside the XML.

LastChild

Read-only

Gets the last child node.

LocalName

Read-only

Gets the local name, which is the local part of a qualified name. This is called the local part in Namespaces in XML.

Name

Read-only

Returns the attribute name.

NamespaceUri

Read-only

Returns the Uniform Resource Identifier (URI) for the namespace.

NextSibling

Read-only

This property is not applicable to this class and will always return null.

NodeName

Read-only

Returns the qualified name for attribute, document type, element, entity, or notation nodes. Returns a fixed string for all other node types.

NodeType

Read-only

Gets the XML Document Object Model (DOM) node type, which determines valid values and whether the node can have child nodes.

NodeValue

Read/write

Gets or sets the text associated with the node.

OwnerDocument

Read-only

Returns the root of the document that contains the node.

ParentNode

Read-only

This property is not applicable to this class and will throw an exception.

Prefix

Read/write

Gets or sets the namespace prefix.

PreviousSibling

Read-only

This property is not applicable to this class and will throw an exception.

Specified

Read-only

Gets a value that indicates whether the attribute is explicitly specified or derived from a default value in the document type definition (DTD) or schema.

Value

Read/write

Gets or sets the attribute value.

 

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Data.Xml.Dom
Windows::Data::Xml::Dom [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Data.Xml.Dom
Windows::Data::Xml::Dom [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

See also

Object
IXmlNode
IXmlNodeSelector
IXmlNodeSerializer

 

 

Show:
© 2016 Microsoft