Difference between revisions of "Extensions.Xml.GetXmlElementsByXPath"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''GetXmlElementsByXPath'''}}Category:Xml == Classification == {{ClassificationActivity | GetXmlElementsByXPath | UPDATING... | Term | Extensions....") |
|||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:OTX '''GetXmlElementsByXPath'''}}[[Category:Xml]] | {{DISPLAYTITLE:OTX '''GetXmlElementsByXPath'''}}[[Category:Xml]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | GetXmlElementsByXPath | | + | {{ClassificationActivity | GetXmlElementsByXPath|Returns a list of XmlElements of an '''XmlDocument'''| [[Term]] | [[Extensions.Xml|OTX Xml extension]] |[[Extensions.Xml#Terms|Xml related Terms]] | [[Extensions.Xml.XPathException|XPathException]] | - |}} |
== OTL Syntax == | == OTL Syntax == | ||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | ListTerm = Xml.GetXmlElementsByXPath(XmlDocumentTerm, StringTerm); | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== Description == | == Description == | ||
− | + | The '''GetXmlElementsByXPath''' term returns a list of XmlElements of an '''XmlDocument''' according to the XPath. If the specified XPath is invalid, an [[Extensions.Xml.XPathException|'''XPathException''']] shall be thrown. | |
− | + | ||
− | + | {{TermReturnValue| [[Core.DataTypes.ComplexDataType.List|List]] | The list of XmlElements of an '''XmlDocument'''.}} | |
− | {{ | ||
− | |||
== Properties == | == Properties == | ||
− | |||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie1| | + | {{TableRowPropertie1| Document|[[Extensions.Xml.XmlDocument|XmlDocument]] | [[Term]] | - |[1..1]| The '''XmlDocument''' object to which the operation is applied.}} |
+ | {{TableRowPropertie2| XPath|[[Core.DataTypes.SimpleDataType.String|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 == | == OTL Examples == | ||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | Xml.XmlDocument XmlDocument1; | |
− | + | List<Xml.XmlElement> List1; | |
− | + | ||
+ | /// Flow | ||
− | / | + | XmlDocument1 = Xml.XmlLoadFromFile("XmlStorage/GetXmlElementsByXPath.xml", @Encoding:UTF-8); |
− | + | List1 = Xml.GetXmlElementsByXPath(XmlDocument1, "/bookstore/book[1]"); | |
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== See also == | == See also == | ||
− | + | [[Extensions.Xml.CopyXmlElement|CopyXmlElement]]<br/> | |
+ | [[Extensions.Xml.CreateXmlDocument|CreateXmlDocument]]<br/> | ||
+ | [[Extensions.Xml.CreateXmlElement|CreateXmlElement]]<br/> | ||
+ | [[Extensions.Xml.GetXmlElementAttributes|GetXmlElementAttributes]]<br/> | ||
+ | [[Extensions.Xml.GetXmlElementChildElements|GetXmlElementChildElements]]<br/> | ||
+ | [[Extensions.Xml.GetXmlElementName|GetXmlElementName]]<br/> | ||
+ | <!--[[Extensions.Xml.GetXmlElementsByXPath|GetXmlElementsByXPath]]<br/>--> | ||
+ | [[Extensions.Xml.GetXmlElementText|GetXmlElementText]]<br/> | ||
+ | [[Extensions.Xml.GetXmlRootElement|GetXmlRootElement]]<br/> | ||
+ | [[Extensions.Xml.XmlFromByteField|XmlFromByteField]]<br/> | ||
+ | [[Extensions.Xml.XmlLoadFromFile|XmlLoadFromFile]]<br/> | ||
+ | [[Extensions.Xml.XmlToByteField|XmlToByteField]]<br/> |
Revision as of 09:45, 9 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
ListTerm = 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
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