Extensions.Xml.GetXmlElementsByXPath

From emotive
Jump to navigation Jump to search

Classification

Name GetXmlElementsByXPath
Short Description Returns a list of XmlElements of an XmlDocument
Class Term
Extension OTX Xml extension
Group Xml related Terms
Exceptions XPathException
Checker Rules -
Standard Compliant Yes

OTL Syntax

ListTerm Xml.GetXmlElementsByXPath(XmlDocumentTerm document, StringTerm xPath);

Description

The GetXmlElementsByXPath term returns a list of XmlElements of an XmlDocument according to the XPath. If the specified XPath is invalid, an XPathException shall be thrown.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
List The list of XmlElements of an XmlDocument.

Properties

Name Data Type Class Default Cardinality Description
Document XmlDocument Term - [1..1] The XmlDocument object to which the operation is applied.
XPath String Term - [1..1] A string representation of the XPath expression. XPath is a query language for selecting nodes from an XML document.

OTL Examples

/// Local Declarations

Xml.XmlDocument XmlDocument1;
List<Xml.XmlElement> List1;
		
/// Flow

XmlDocument1 = Xml.XmlLoadFromFile("XmlStorage/GetXmlElementsByXPath.xml", @Encoding:UTF-8);
List1 = Xml.GetXmlElementsByXPath(XmlDocument1, "/bookstore/book[1]");

See also

CopyXmlElement
CreateXmlDocument
CreateXmlElement
GetXmlElementAttributes
GetXmlElementChildElements
GetXmlElementName
GetXmlElementText
GetXmlRootElement
XmlFromByteField
XmlLoadFromFile
XmlToByteField