OTX Reference  
OpenTestSystem.Otx.Extensions.XML.Terms.GetXmlElementsByXPath Class Reference

Returns a list of XmlElements of a XmlDocument according to the XPath. More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.XML.Terms.GetXmlElementsByXPath:
Inheritance graph

Public Attributes

XmlDocumentTerm document
 Cardinality [1]
The XmlDocument object to which the operation is applied. More...
 
StringTerm xPath
 Cardinality [1]
A string representation of the XPath expression. XPath is a query language for selecting nodes from an XML document. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Terms.Term
MetaData metaData
 Cardinality [0..1]
The MetaData type allows tools to store additional, mainly tool-specific data. More...
 

Detailed Description

Returns a list of XmlElements of a XmlDocument according to the XPath.

The GetXmlElementsByXPath activity returns a list of XmlElements of a XmlDocument according to the XPath. The returned list shall be empty if no matches are found. If the specified XPath is invalid, an XPathException shall be thrown.

Exceptions
Exceptions.XPathExceptionIf the path has a syntax error, or if it matches a node that is not an XML element (e.g. if it matches an XML attribute).
Syntax
ListTerm = Xml.GetXmlElementsByXPath(XmlDocumentTerm document, StringTerm xPath);
StringTerm xPath
Cardinality [1] A string representation of the XPath expression. XPath is a query language for select...
Definition: XML.cs:1323
XmlDocumentTerm document
Cardinality [1] The XmlDocument object to which the operation is applied.
Definition: XML.cs:1313
Examples
// Local Declarations
Xml.XmlElement XmlElement1;
List<Xml.XmlElement> List1;
// Flow
XmlDocument1 = Xml.XmlLoadFromFile("XmlStorage/GetXmlElementsByXPath.xml", @Encoding:UTF-8);
List1 = Xml.GetXmlElementsByXPath(XmlDocument1, "/bookstore/book[1]");

Member Data Documentation

◆ document

XmlDocumentTerm OpenTestSystem.Otx.Extensions.XML.Terms.GetXmlElementsByXPath.document

Cardinality [1]
The XmlDocument object to which the operation is applied.

◆ xPath

StringTerm OpenTestSystem.Otx.Extensions.XML.Terms.GetXmlElementsByXPath.xPath

Cardinality [1]
A string representation of the XPath expression. XPath is a query language for selecting nodes from an XML document.