XmlComment XmlComment XmlComment XmlComment XmlComment Class

Definition

Represents an XML comment.

public : sealed class XmlComment : IXmlCharacterData, IXmlComment, IXmlNode, IXmlNodeSelector, IXmlNodeSerializer
struct winrt::Windows::Data::Xml::Dom::XmlComment : IXmlCharacterData, IXmlComment, IXmlNode, IXmlNodeSelector, IXmlNodeSerializer
public sealed class XmlComment : IXmlCharacterData, IXmlComment, IXmlNode, IXmlNodeSelector, IXmlNodeSerializer
Public NotInheritable Class XmlComment Implements IXmlCharacterData, IXmlComment, IXmlNode, IXmlNodeSelector, IXmlNodeSerializer
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Attributes Attributes Attributes Attributes Attributes

Gets the list of attributes of this node.

public : XmlNamedNodeMap Attributes { get; }
XmlNamedNodeMap Attributes();
public XmlNamedNodeMap Attributes { get; }
Public ReadOnly Property Attributes As XmlNamedNodeMap
var xmlNamedNodeMap = xmlComment.attributes;
Value
XmlNamedNodeMap XmlNamedNodeMap XmlNamedNodeMap

The attributes for this node.

ChildNodes ChildNodes ChildNodes ChildNodes ChildNodes

Gets a list of children in the current node. This method always returns NULL.

public : XmlNodeList ChildNodes { get; }
XmlNodeList ChildNodes();
public XmlNodeList ChildNodes { get; }
Public ReadOnly Property ChildNodes As XmlNodeList
var xmlNodeList = xmlComment.childNodes;
Value
XmlNodeList XmlNodeList XmlNodeList

The list of child nodes. This value is always NULL.

Data Data Data Data Data

Gets or sets the node data depending on the node type.

public : Platform::String Data { get; set; }
winrt::hstring Data(); void Data(winrt::hstring data);
public string Data { get; set; }
Public ReadWrite Property Data As string
var string = xmlComment.data;
xmlComment.data = string;
Value
string string string

The node data.

FirstChild FirstChild FirstChild FirstChild FirstChild

Gets the first child node. This property always returns NULL.

public : IXmlNode FirstChild { get; }
IXmlNode FirstChild();
public IXmlNode FirstChild { get; }
Public ReadOnly Property FirstChild As IXmlNode
var iXmlNode = xmlComment.firstChild;
Value
IXmlNode IXmlNode IXmlNode

The first child node. This property returns NULL if there are no children.

InnerText InnerText InnerText InnerText InnerText

Gets the text from inside the XML.

public : Platform::String InnerText { get; set; }
winrt::hstring InnerText(); void InnerText(winrt::hstring innertext);
public string InnerText { get; set; }
Public ReadWrite Property InnerText As string
var string = xmlComment.innerText;
xmlComment.innerText = string;
Value
string string string

The text from inside the XML. Returns an empty string if there is no text.

LastChild LastChild LastChild LastChild LastChild

Gets the last child node. This property always returns NULL.

public : IXmlNode LastChild { get; }
IXmlNode LastChild();
public IXmlNode LastChild { get; }
Public ReadOnly Property LastChild As IXmlNode
var iXmlNode = xmlComment.lastChild;
Value
IXmlNode IXmlNode IXmlNode

The last child node. This property always returns NULL.

Length Length Length Length Length

Gets the length of the data in Unicode characters.

public : unsigned int Length { get; }
uint32_t Length();
public uint Length { get; }
Public ReadOnly Property Length As uint
var uint = xmlComment.length;
Value
uint uint uint

The length of the data, in Unicode characters.

LocalName LocalName LocalName LocalName LocalName

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

public : Platform::Object LocalName { get; }
winrt::Windows::Foundation::IInspectable LocalName();
public object LocalName { get; }
Public ReadOnly Property LocalName As object
var object = xmlComment.localName;
Value
object object object

The local name.

NamespaceUri NamespaceUri NamespaceUri NamespaceUri NamespaceUri

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

public : Platform::Object NamespaceUri { get; }
winrt::Windows::Foundation::IInspectable NamespaceUri();
public object NamespaceUri { get; }
Public ReadOnly Property NamespaceUri As object
var object = xmlComment.namespaceUri;
Value
object object object

The Uri for the namespace. This refers to the "uuu" portion of the namespace declaration xmlns:nnn="uuu".

NextSibling NextSibling NextSibling NextSibling NextSibling

Gets the next sibling of the node in the parent's child list.

public : IXmlNode NextSibling { get; }
IXmlNode NextSibling();
public IXmlNode NextSibling { get; }
Public ReadOnly Property NextSibling As IXmlNode
var iXmlNode = xmlComment.nextSibling;
Value
IXmlNode IXmlNode IXmlNode

The right sibling of this node.

NodeName NodeName NodeName NodeName NodeName

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

public : Platform::String NodeName { get; }
winrt::hstring NodeName();
public string NodeName { get; }
Public ReadOnly Property NodeName As string
var string = xmlComment.nodeName;
Value
string string string

The qualified node name, which varies depending on the node type.

NodeType NodeType NodeType NodeType NodeType

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

public : NodeType NodeType { get; }
NodeType NodeType();
public NodeType NodeType { get; }
Public ReadOnly Property NodeType As NodeType
var nodeType = xmlComment.nodeType;
Value
NodeType NodeType NodeType

The node type.

NodeValue NodeValue NodeValue NodeValue NodeValue

Gets or sets the text associated with the node.

public : Platform::Object NodeValue { get; set; }
winrt::Windows::Foundation::IInspectable NodeValue(); void NodeValue(winrt::Windows::Foundation::IInspectable nodevalue);
public object NodeValue { get; set; }
Public ReadWrite Property NodeValue As object
var object = xmlComment.nodeValue;
xmlComment.nodeValue = object;
Value
object object object

Gets or sets the text associated with the node.

OwnerDocument OwnerDocument OwnerDocument OwnerDocument OwnerDocument

Returns the root of the document that contains the node.

public : XmlDocument OwnerDocument { get; }
XmlDocument OwnerDocument();
public XmlDocument OwnerDocument { get; }
Public ReadOnly Property OwnerDocument As XmlDocument
var xmlDocument = xmlComment.ownerDocument;
Value
XmlDocument XmlDocument XmlDocument

The parent document that represents the root of the document.

ParentNode ParentNode ParentNode ParentNode ParentNode

Gets the parent node of the node instance.

public : IXmlNode ParentNode { get; }
IXmlNode ParentNode();
public IXmlNode ParentNode { get; }
Public ReadOnly Property ParentNode As IXmlNode
var iXmlNode = xmlComment.parentNode;
Value
IXmlNode IXmlNode IXmlNode

The parent node.

Prefix Prefix Prefix Prefix Prefix

Gets or sets the namespace prefix.

public : Platform::Object Prefix { get; set; }
winrt::Windows::Foundation::IInspectable Prefix(); void Prefix(winrt::Windows::Foundation::IInspectable prefix);
public object Prefix { get; set; }
Public ReadWrite Property Prefix As object
var object = xmlComment.prefix;
xmlComment.prefix = object;
Value
object object object

The namespace prefix specified on the element, attribute, or entity reference. For example, for the element <xxx:yyy>, this property returns xxx. It returns an empty string, "", if no prefix is specified.

PreviousSibling PreviousSibling PreviousSibling PreviousSibling PreviousSibling

Gets the previous sibling of the node in the parent's child list.

public : IXmlNode PreviousSibling { get; }
IXmlNode PreviousSibling();
public IXmlNode PreviousSibling { get; }
Public ReadOnly Property PreviousSibling As IXmlNode
var iXmlNode = xmlComment.previousSibling;
Value
IXmlNode IXmlNode IXmlNode

The left sibling of this node.

Methods

AppendChild(IXmlNode) AppendChild(IXmlNode) AppendChild(IXmlNode) AppendChild(IXmlNode) AppendChild(IXmlNode)

Appends a new child node as the last child of the node. This method is not applicable to this class and it will throw an exception.

public : IXmlNode AppendChild(IXmlNode newChild)
IXmlNode AppendChild(IXmlNode newChild) const;
public IXmlNode AppendChild(IXmlNode newChild)
Public Function AppendChild(newChild As IXmlNode) As IXmlNode
var iXmlNode = xmlComment.appendChild(newChild);
Parameters
newChild
IXmlNode IXmlNode IXmlNode

The new child node to be appended to the end of the list of children of this node.

Returns

The new child node successfully appended to the list. If null, no object is created.

AppendData(String) AppendData(String) AppendData(String) AppendData(String) AppendData(String)

Appends the supplied string to the existing string data.

public : void AppendData(Platform::String data)
void AppendData(winrt::hstring data) const;
public void AppendData(String data)
Public Function AppendData(data As String) As void
xmlComment.appendData(data);
Parameters
data
String String String

The data to be appended to the existing string.

CloneNode(Boolean) CloneNode(Boolean) CloneNode(Boolean) CloneNode(Boolean) CloneNode(Boolean)

Clones a new node.

public : IXmlNode CloneNode(bool deep)
IXmlNode CloneNode(bool deep) const;
public IXmlNode CloneNode(Boolean deep)
Public Function CloneNode(deep As Boolean) As IXmlNode
var iXmlNode = xmlComment.cloneNode(deep);
Parameters
deep
Boolean Boolean Boolean

A flag that indicates whether to recursively clone all nodes that are descendants of this node. If true, this method creates a clone of the complete tree below this node. If false, this method clones this node and its attributes only.

Returns

The newly created clone node.

DeleteData(UInt32, UInt32) DeleteData(UInt32, UInt32) DeleteData(UInt32, UInt32) DeleteData(UInt32, UInt32) DeleteData(UInt32, UInt32)

Deletes the specified data.

public : void DeleteData(unsigned int offset, unsigned int count)
void DeleteData(uint32_t offset, uint32_t count) const;
public void DeleteData(UInt32 offset, UInt32 count)
Public Function DeleteData(offset As UInt32, count As UInt32) As void
xmlComment.deleteData(offset, count);
Parameters
offset
UInt32 UInt32 UInt32

The offset, in characters, at which to start deleting the string data.

count
UInt32 UInt32 UInt32

The number of characters to delete.

GetXml() GetXml() GetXml() GetXml() GetXml()

Returns the XML representation of the node and all its descendants.

public : Platform::String GetXml()
winrt::hstring GetXml() const;
public string GetXml()
Public Function GetXml() As string
var string = xmlComment.getXml();
Returns
string string string

The XML representation of the node and all its descendants.

HasChildNodes() HasChildNodes() HasChildNodes() HasChildNodes() HasChildNodes()

Determines whether a node has children.

public : Platform::Boolean HasChildNodes()
bool HasChildNodes() const;
public bool HasChildNodes()
Public Function HasChildNodes() As bool
var bool = xmlComment.hasChildNodes();
Returns
bool bool bool

True if this node has children; otherwise false.

InsertBefore(IXmlNode, IXmlNode) InsertBefore(IXmlNode, IXmlNode) InsertBefore(IXmlNode, IXmlNode) InsertBefore(IXmlNode, IXmlNode) InsertBefore(IXmlNode, IXmlNode)

Inserts a child node to the left of the specified node, or at the end of the list. This method is not applicable to this class and will throw an exception.

public : IXmlNode InsertBefore(IXmlNode newChild, IXmlNode referenceChild)
IXmlNode InsertBefore(IXmlNode newChild, IXmlNode referenceChild) const;
public IXmlNode InsertBefore(IXmlNode newChild, IXmlNode referenceChild)
Public Function InsertBefore(newChild As IXmlNode, referenceChild As IXmlNode) As IXmlNode
var iXmlNode = xmlComment.insertBefore(newChild, referenceChild);
Parameters
newChild
IXmlNode IXmlNode IXmlNode

The address of the new node to be inserted. The node passed here must be a valid child of the current XML DOM document node. For example, if the current node is an attribute, you cannot pass another attribute in the newChild parameter, because an attribute cannot have an attribute as a child. If newChild is a DOCUMENT_FRAGMENT node type, all its children are inserted in order before referenceChild.

If newChild is already in the tree, it is first removed before it is reinserted before the referenceChild node. Read-only nodes, such as NODE_DOCUMENT_TYPE and NODE_ENTITY nodes, cannot be passed in the newChild parameter.

referenceChild
IXmlNode IXmlNode IXmlNode

The reference node. The node specified is where the newChild node is to be inserted to the left as the preceding sibling in the child list. The node passed here must be a either a child node of the current node or null. If the value is null, the newChild node is inserted at the end of the child list. If the referenceChild node is not a child of the current node, an error is returned.

Returns

On success, the child node that was inserted. If null, no object is created.

InsertData(UInt32, String) InsertData(UInt32, String) InsertData(UInt32, String) InsertData(UInt32, String) InsertData(UInt32, String)

Inserts a string at the specified offset.

public : void InsertData(unsigned int offset, Platform::String data)
void InsertData(uint32_t offset, winrt::hstring data) const;
public void InsertData(UInt32 offset, String data)
Public Function InsertData(offset As UInt32, data As String) As void
xmlComment.insertData(offset, data);
Parameters
offset
UInt32 UInt32 UInt32

The offset, in characters, at which to insert the supplied string data.

data
String String String

The data to be inserted into the existing string.

Normalize() Normalize() Normalize() Normalize() Normalize()

Normalizes all descendant elements by combining two or more adjacent text nodes into one unified text node.

public : void Normalize()
void Normalize() const;
public void Normalize()
Public Function Normalize() As void
xmlComment.normalize();

RemoveChild(IXmlNode) RemoveChild(IXmlNode) RemoveChild(IXmlNode) RemoveChild(IXmlNode) RemoveChild(IXmlNode)

Removes the specified child node from the list of children and returns it. This method is not applicable to this class and will throw an exception.

public : IXmlNode RemoveChild(IXmlNode childNode)
IXmlNode RemoveChild(IXmlNode childNode) const;
public IXmlNode RemoveChild(IXmlNode childNode)
Public Function RemoveChild(childNode As IXmlNode) As IXmlNode
var iXmlNode = xmlComment.removeChild(childNode);
Parameters
childNode
IXmlNode IXmlNode IXmlNode

The child node to be removed from the list of children of this node.

Returns

The removed child node. If null, the childNode object is not removed.

ReplaceChild(IXmlNode, IXmlNode) ReplaceChild(IXmlNode, IXmlNode) ReplaceChild(IXmlNode, IXmlNode) ReplaceChild(IXmlNode, IXmlNode) ReplaceChild(IXmlNode, IXmlNode)

Replaces the specified old child node with the supplied new child node. This method is not applicable to this class and will throw an exception.

public : IXmlNode ReplaceChild(IXmlNode newChild, IXmlNode referenceChild)
IXmlNode ReplaceChild(IXmlNode newChild, IXmlNode referenceChild) const;
public IXmlNode ReplaceChild(IXmlNode newChild, IXmlNode referenceChild)
Public Function ReplaceChild(newChild As IXmlNode, referenceChild As IXmlNode) As IXmlNode
var iXmlNode = xmlComment.replaceChild(newChild, referenceChild);
Parameters
newChild
IXmlNode IXmlNode IXmlNode

The new child that is to replace the old child. If null, the referenceChild parameter is removed without a replacement.

referenceChild
IXmlNode IXmlNode IXmlNode

The old child that is to be replaced by the new child.

Returns

The old child that is replaced. If null, no object is created.

ReplaceData(UInt32, UInt32, String) ReplaceData(UInt32, UInt32, String) ReplaceData(UInt32, UInt32, String) ReplaceData(UInt32, UInt32, String) ReplaceData(UInt32, UInt32, String)

Replaces the specified number of characters with the supplied string.

public : void ReplaceData(unsigned int offset, unsigned int count, Platform::String data)
void ReplaceData(uint32_t offset, uint32_t count, winrt::hstring data) const;
public void ReplaceData(UInt32 offset, UInt32 count, String data)
Public Function ReplaceData(offset As UInt32, count As UInt32, data As String) As void
xmlComment.replaceData(offset, count, data);
Parameters
offset
UInt32 UInt32 UInt32

The offset, in characters, at which to start replacing string data.

count
UInt32 UInt32 UInt32

The number of characters to replace.

data
String String String

The new data that replaces the old string data.

SelectNodes(String) SelectNodes(String) SelectNodes(String) SelectNodes(String) SelectNodes(String)

Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList. This method is not applicable to this class and will throw an exception.

public : XmlNodeList SelectNodes(Platform::String xpath)
XmlNodeList SelectNodes(winrt::hstring xpath) const;
public XmlNodeList SelectNodes(String xpath)
Public Function SelectNodes(xpath As String) As XmlNodeList
var xmlNodeList = xmlComment.selectNodes(xpath);
Parameters
xpath
String String String

Specifies an XPath expression.

Returns

The collection of nodes selected by applying the given pattern-matching operation. If no nodes are selected, this method returns an empty collection.

SelectNodesNS(String, Object) SelectNodesNS(String, Object) SelectNodesNS(String, Object) SelectNodesNS(String, Object) SelectNodesNS(String, Object)

Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList. This method is not applicable to this class and will throw an exception.

public : XmlNodeList SelectNodesNS(Platform::String xpath, Platform::Object namespaces)
XmlNodeList SelectNodesNS(winrt::hstring xpath, winrt::Windows::Foundation::IInspectable namespaces) const;
public XmlNodeList SelectNodesNS(String xpath, Object namespaces)
Public Function SelectNodesNS(xpath As String, namespaces As Object) As XmlNodeList
var xmlNodeList = xmlComment.selectNodesNS(xpath, namespaces);
Parameters
xpath
String String String

Specifies an XPath expresssion.

namespaces
Object Object Object

Contains a string that specifies namespaces for use in XPath expressions when it is necessary to define new namespaces externally. Namespaces are defined in the XML style, as a space-separated list of namespace declaration attributes. You can use this property to set the default namespace as well.

Returns

The collection of nodes selected by applying the given pattern-matching operation. If no nodes are selected, returns an empty collection.

SelectSingleNode(String) SelectSingleNode(String) SelectSingleNode(String) SelectSingleNode(String) SelectSingleNode(String)

Applies the specified pattern-matching operation to this node's context and returns the first matching node. This method is not applicable to this class and will throw an exception.

public : IXmlNode SelectSingleNode(Platform::String xpath)
IXmlNode SelectSingleNode(winrt::hstring xpath) const;
public IXmlNode SelectSingleNode(String xpath)
Public Function SelectSingleNode(xpath As String) As IXmlNode
var iXmlNode = xmlComment.selectSingleNode(xpath);
Parameters
xpath
String String String

Specifies an XPath expression.

Returns

The first node that matches the given pattern-matching operation. If no nodes match the expression, the method returns a null value.

SelectSingleNodeNS(String, Object) SelectSingleNodeNS(String, Object) SelectSingleNodeNS(String, Object) SelectSingleNodeNS(String, Object) SelectSingleNodeNS(String, Object)

Applies the specified pattern-matching operation to this node's context and returns the first matching node. This method is not applicable to this class and will throw an exception.

public : IXmlNode SelectSingleNodeNS(Platform::String xpath, Platform::Object namespaces)
IXmlNode SelectSingleNodeNS(winrt::hstring xpath, winrt::Windows::Foundation::IInspectable namespaces) const;
public IXmlNode SelectSingleNodeNS(String xpath, Object namespaces)
Public Function SelectSingleNodeNS(xpath As String, namespaces As Object) As IXmlNode
var iXmlNode = xmlComment.selectSingleNodeNS(xpath, namespaces);
Parameters
xpath
String String String

Specifies an XPath expression.

namespaces
Object Object Object

Contains a string that specifies the namespaces to use in XPath expressions when it is necessary to define new namespaces externally. Namespaces are defined in the XML style, as a space-separated list of namespace declaration attributes. You can use this property to set the default namespace as well.

Returns

The first node that matches the given pattern-matching operation. If no nodes match the expression, this method returns a null value.

SubstringData(UInt32, UInt32) SubstringData(UInt32, UInt32) SubstringData(UInt32, UInt32) SubstringData(UInt32, UInt32) SubstringData(UInt32, UInt32)

Retrieves a substring of the full string from the specified range.

public : Platform::String SubstringData(unsigned int offset, unsigned int count)
winrt::hstring SubstringData(uint32_t offset, uint32_t count) const;
public string SubstringData(UInt32 offset, UInt32 count)
Public Function SubstringData(offset As UInt32, count As UInt32) As string
var string = xmlComment.substringData(offset, count);
Parameters
offset
UInt32 UInt32 UInt32

Specifies the offset, in characters, from the beginning of the string. An offset of zero indicates copying from the start of the data.

count
UInt32 UInt32 UInt32

Specifies the number of characters to retrieve from the specified offset.

Returns
string string string

The returned substring.