XML functions
XMLAddElement
Declaration
void XMLAddElement(XMLDocument document, XMLElement element)
Description
Adds an element to a document.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
document
|
The document to add an element to.
|
element
|
The element to be added.
|
Return Value
Does not return a value.
XMLAddElement
Declaration
void XMLAddElement(XMLElement parent, XMLElement element)
Description
Adds an element to an element.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
parent
|
The element to add an element to.
|
element
|
The element to be added.
|
Return Value
Does not return a value.
XMLAddNamespace
Declaration
void XMLAddNamespace(XMLNamespaceManager manager, string prefix, string uri)
Description
Adds a given namespace to an XMLNamespaceManager.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
manager
|
The XMLNamespaceManager to add the namespace to.
|
prefix
|
Prefix of the namespace to be added.
|
uri
|
URI of the namespace to be added.
|
Return Value
Does not return a value.
XMLCreateDocument
Declaration
XMLDocument XMLCreateDocument()
Description
Creates a new XMLDocument.
Supported Runtime Versions
5.0
Parameters
The function has no parameters.
Return Value
A new XMLDocument.
XMLCreateDocument
Declaration
XMLDocument XMLCreateDocument(string version, string encoding, string standalone)
Description
Creates a new XMLDocument.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
version
|
The version of the XML document. Usually, this is "1.0".
|
encoding
|
The character set encoding used in the XML document.
|
standalone
|
Set to "yes" for a standalone XML document. Set to "no" otherwise.
|
Return Value
A new XMLDocument.
XMLCreateElement
Declaration
XMLElement XMLCreateElement(string name)
Description
Creates a new XMLElement.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
name
|
Name of the XMLElement.
|
Return Value
A new XMLElement.
XMLCreateElement
Declaration
XMLElement XMLCreateElement(XMLNamespace xmlNamespace, string name)
Description
Creates a new XMLElement.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
xmlNamespace
|
Namespace of the XMLElement.
|
name
|
Name of the XMLElement.
|
Return Value
A new XMLElement.
XMLCreateNamespace
Declaration
XMLNamespace XMLCreateNamespace(string uri)
Description
Creates a new XMLNamespace object.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
uri
|
The namespace URI.
|
Return Value
The new XMLNamespace object.
XMLCreateNamespaceManager
Declaration
XMLNamespaceManager XMLCreateNamespaceManager(XMLDocument document)
Description
Creates a new XMLNamespaceManager object.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
document
|
The XMLDocument to create the XMLNamespaceManager for.
|
Return Value
A new XMLNamespaceManager object.
XMLCreateNamespaceManager
Declaration
XMLNamespaceManager XMLCreateNamespaceManager()
Description
Creates a new XMLNamespaceManager object.
Supported Runtime Versions
5.0
Parameters
The function has no parameters.
Return Value
A new XMLNamespaceManager object.
XMLCreateXmlNamespace
Declaration
XMLNamespace XMLCreateXmlNamespace()
Description
Creates a new XMLNamespace object that refers to the standard xml namespace.
Supported Runtime Versions
5.0
Parameters
The function has no parameters.
Return Value
The new XMLNamespace object.
XMLCreateXmlnsNamespace
Declaration
XMLNamespace XMLCreateXmlnsNamespace()
Description
Creates a new XMLNamespace object that refers to the standard xmlns namespace.
Supported Runtime Versions
5.0
Parameters
The function has no parameters.
Return Value
The new XMLNamespace object.
XMLGetAttribute
Declaration
XMLAttribute XMLGetAttribute(XMLElement element, string xmlNamespace, string name)
Description
Returns a certain attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the attribute for.
|
xmlNamespace
|
Namespace of the attribute to be returned.
|
name
|
Name of the attribute to be returned.
|
Return Value
The specified attribute.
XMLGetAttribute
Declaration
XMLAttribute XMLGetAttribute(XMLElement element, XMLNamespace xmlNamespace, string name)
Description
Returns a certain attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the attribute for.
|
xmlNamespace
|
Namespace of the attribute to be returned.
|
name
|
Name of the attribute to be returned.
|
Return Value
The specified attribute.
XMLGetAttribute
Declaration
XMLAttribute XMLGetAttribute(XMLElement element, string name)
Description
Returns a certain attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the attribute for.
|
name
|
Name of the attribute to be returned.
|
Return Value
The specified attribute.
XMLGetAttributes
Declaration
XMLAttributeList XMLGetAttributes(XMLElement element)
Description
Returns all attributes of an element.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to receive all attributes for.
|
Return Value
All attributes of the element.
XMLGetAttributeValue
Declaration
string XMLGetAttributeValue(XMLElement element, string xmlNamespace, string name)
Description
Returns the value of a certain attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to receive the attribute value for.
|
xmlNamespace
|
Namespace of the attribute.
|
name
|
Name of the attribute.
|
Return Value
The value of the specified attribute.
XMLGetAttributeValue
Declaration
string XMLGetAttributeValue(XMLElement element, XMLNamespace xmlNamespace, string name)
Description
Returns the value of a certain attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to receive the attribute value for.
|
xmlNamespace
|
Namespace of the attribute.
|
name
|
Name of the attribute.
|
Return Value
The value of the specified attribute.
XMLGetAttributeValue
Declaration
string XMLGetAttributeValue(XMLElement element, string name)
Description
Returns the value of a certain attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to receive the attribute value for.
|
name
|
Name of the attribute.
|
Return Value
The value of the specified attribute.
XMLGetChildElement
Declaration
XMLElement XMLGetChildElement(XMLElement element, string name)
Description
Returns the first child element (in document order) with the specified name.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the child element for.
|
name
|
Name of the element to be returned.
|
Return Value
The first child element (in document order) with the specified name.
XMLGetChildElement
Declaration
XMLElement XMLGetChildElement(XMLElement element, string xmlNamespace, string name)
Description
Returns the first child element (in document order) with the specified name and namespace.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the child element for.
|
xmlNamespace
|
The namespace of the child element to be returned.
|
name
|
Name of the element to be returned.
|
Return Value
The first child element (in document order) with the specified name.
XMLGetChildElement
Declaration
XMLElement XMLGetChildElement(XMLElement element, XMLNamespace xmlNamespace, string name)
Description
Returns the first child element (in document order) with the specified name and namespace.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the child element for.
|
xmlNamespace
|
The namespace of the child element to be returned.
|
name
|
Name of the element to be returned.
|
Return Value
The first child element (in document order) with the specified name.
XMLGetChildElements
Declaration
XMLElementList XMLGetChildElements(XMLElement element, string name)
Description
Returns all child elements with the specified name.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the child elements for.
|
name
|
Name of the elements to be returned.
|
Return Value
All child elements with the specified name.
XMLGetChildElements
Declaration
XMLElementList XMLGetChildElements(XMLElement element, string xmlNamespace, string name)
Description
Returns all child elements with the specified name and namespace.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the child elements for.
|
xmlNamespace
|
The namespace of the child elements to be returned.
|
name
|
Name of the elements to be returned.
|
Return Value
All child elements with the specified name.
XMLGetChildElements
Declaration
XMLElementList XMLGetChildElements(XMLElement element, XMLNamespace xmlNamespace, string name)
Description
Returns all child elements with the specified name and namespace.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to return the child elements for.
|
xmlNamespace
|
The namespace of the child elements to be returned.
|
name
|
Names of the elements to be returned.
|
Return Value
All child elements with the specified name.
XMLGetContent
Declaration
string XMLGetContent(XMLElement element)
Description
Returns the content of an XMLElement.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to receive the content of.
|
Return Value
The content of the XMLElement.
XMLGetExpandedName
Declaration
string XMLGetExpandedName(XMLElement element)
Description
Returns an XMLElement's expanded name.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
XMLElement to receive the expanded name for.
|
Return Value
The XMLElement's expanded name.
XMLGetExpandedName
Declaration
string XMLGetExpandedName(XMLAttribute attribute)
Description
Returns the expanded name of an attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
attribute
|
The attribute to return the expanded name for.
|
Return Value
The attribute's expanded name.
XMLGetLocalName
Declaration
string XMLGetLocalName(XMLElement element)
Description
Returns an XMLElement's local name.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
XMLElement to receive the local name for.
|
Return Value
The XMLElement's local name.
XMLGetLocalName
Declaration
string XMLGetLocalName(XMLAttribute attribute)
Description
Returns the local name of an attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
attribute
|
The attribute to return the local name for.
|
Return Value
The attribute's local name.
XMLGetRootElement
Declaration
XMLElement XMLGetRootElement(XMLDocument document)
Description
Returns the root element of an XMLDocument.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
document
|
The XMLDocument to receive the root element for.
|
Return Value
The root element of the XMLDocument.
XMLGetValue
Declaration
string XMLGetValue(XMLAttribute attribute)
Description
Returns an attribute's value.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
attribute
|
The attribute to return the value for.
|
Return Value
The value of the attribute.
XMLHasAttribute
Declaration
bool XMLHasAttribute(XMLElement element, string name)
Description
Checks, if an element has an attribute having a certain name.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to be checked.
|
name
|
Name of the attribute to be checked.
|
Return Value
True, if the element has an attribute with the specified name. False otherwise.
XMLHasAttribute
Declaration
bool XMLHasAttribute(XMLElement element, string xmlNamespace, string name)
Description
Checks, if an element has an attribute having a certain name.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to be checked.
|
xmlNamespace
|
Namespace of the attribute to be checked.
|
name
|
Name of the attribute to be checked.
|
Return Value
True, if the element has an attribute with the specified name, false otherwise.
XMLHasAttribute
Declaration
bool XMLHasAttribute(XMLElement element, XMLNamespace xmlNamespace, string name)
Description
Checks, if an element has an attribute having a certain name.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to be checked.
|
xmlNamespace
|
Namespace of the attribute to be checked.
|
name
|
Name of the attribute to be checked.
|
Return Value
True, if the element has an attribute with the specified name, false otherwise.
XMLHasElement
Declaration
bool XMLHasElement(XMLElement element, string name)
Description
Checks, if an element has a child element having a certain name.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to be checked.
|
name
|
Name of the child element to be checked.
|
Return Value
True, if the element has a child element with the specified name, false otherwise.
XMLParseDocument
Declaration
XMLDocument XMLParseDocument(string xmlString)
Description
Converts an XML string into an XMLDocument.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
xmlString
|
The XML string to be converted.
|
Return Value
An XMLDocument representing the XML string.
XMLSetAttributeValue
Declaration
void XMLSetAttributeValue(XMLElement element, string name, string value)
Description
Sets the value of an attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to set the attribute value for.
|
name
|
Name of the attribute to be set.
|
value
|
Value of the attribute to be set.
|
Return Value
Does not return a value.
XMLSetAttributeValue
Declaration
void XMLSetAttributeValue(XMLElement element, XMLNamespace xmlNamespace, string prefix, string value)
Description
Sets the value of an attribute.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The XMLElement to set the attribute value for.
|
xmlNamespace
|
Namespace of the attribute to be set.
|
prefix
|
Prefix of the attribute to be set.
|
value
|
Value of the attribute to be set.
|
Return Value
Does not return a value.
XMLSetContent
Declaration
void XMLSetContent(XMLElement element, string content)
Description
Sets the content of an XMLElement.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to set the content for.
|
content
|
The content to be set.
|
Return Value
Does not return a value.
XMLSetValue
Declaration
void XMLSetValue(XMLAttribute attribute, string value)
Description
Sets an attribute's value.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
attribute
|
Attribute to set value for.
|
value
|
The value to be set.
|
Return Value
Does not return a value.
XMLXPathHasElement
Declaration
bool XMLXPathHasElement(XMLElement element, string xpath, XMLNamespaceManager namespaceManager)
Description
Checks, whether an XPath expression returns an element.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to check the XPath expression for.
|
xpath
|
The XPath expression to be checked.
|
namespaceManager
|
The XMLNamespaceManager to be used for resolving namespaces.
|
Return Value
True, if the XPath expression returns an element. False, if the XPath expression does not return an element.
XMLXPathHasElements
Declaration
bool XMLXPathHasElements(XMLElement element, string xpath, XMLNamespaceManager namespaceManager)
Description
Checks, whether an XPath expression returns a list of elements.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to check the XPath expression for.
|
xpath
|
The XPath expression to be checked.
|
namespaceManager
|
The XMLNamespaceManager to be used for resolving namespaces.
|
Return Value
True, if the XPath expression returns a list of elements. False, if the XPath expression does not return a list of elements.
XMLXPathSelectElement
Declaration
XMLElement XMLXPathSelectElement(XMLElement element, string xpath, XMLNamespaceManager namespaceManager)
Description
Returns an element specified by an XPath expression.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to apply the XPath expression for.
|
xpath
|
The XPath expression identifying the element.
|
namespaceManager
|
The XMLNamespaceManager to be used for resolving namespaces.
|
Return Value
The element specified by the XPath expression.
XMLXPathSelectElements
Declaration
XMLElementList XMLXPathSelectElements(XMLElement element, string xpath, XMLNamespaceManager namespaceManager)
Description
Returns a list of elements specified by an XPath expression.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
element
|
The element to apply the XPath expression for.
|
xpath
|
The XPath expression identifying the element.
|
namespaceManager
|
The XMLNamespaceManager to be used for resolving namespaces.
|
Return Value
The list of elements specified by the XPath expression.