Difference between revisions of "Extensions.Xml.GetXmlElementsByXPath"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | /// Local Declarations | |
+ | List<Xml.XmlElement> ListVariable; | ||
+ | /// Flow | ||
+ | ListVariable = Xml.GetXmlElementsByXPath(XmlDocumentTerm, StringTerm); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 22: | Line 25: | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | /// Local Declarations | ||
+ | |||
Xml.XmlDocument XmlDocument1; | Xml.XmlDocument XmlDocument1; | ||
List<Xml.XmlElement> List1; | List<Xml.XmlElement> List1; |
Revision as of 10:28, 25 October 2018
Contents
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
/// Local Declarations
List<Xml.XmlElement> ListVariable;
/// Flow
ListVariable = Xml.GetXmlElementsByXPath(XmlDocumentTerm, StringTerm);
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.
![]()
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