Jump to: navigation, search

Changes


Activity:GetXPathResult (Activity)

2,501 bytes added, 19:09, 22 July 2013
Created page with "The GetXPathResult Activity evaluates an XPath expression in XML data. This data is typically provided by the [[Activity ReadXPathDocument|ReadXPathDocument]] activity or a pr..."
The GetXPathResult Activity evaluates an XPath expression in XML data. This data is typically provided by the [[Activity ReadXPathDocument|ReadXPathDocument]] activity or a predecessing GetXPathResult activity.

{{ActivityInfoBox
| title = Get XPath Result
| name = GetXPathResult
| internalname = GetXPathResult
| image =
| imagecaption = Activity GetXPathResult
| purpose = Evaluate an XPath expression
| category = Data Exchange
| returns = True if successful
| version = 2.1.15+
}}







==Argument==

{| class="wikitable sortable" | width = "50%"
|-
! Arguments!! Type !! Direction !! Purpose
|- align="left"
| XPathDocument|| String || In || The XML data to evaluate the expression on
|- align="left"
| XPathExpression || String|| In || The XPath expression
|- align="left"
| XPathNavigator || XPathNavigator|| In || The XPathNavigator object to evaluate the expression on; overrules ''XPathDocument'' if set
|- align="left"
| XPathResult || List<XPathNavigator>|| Out || All XML data as XPathNavigator objects where expression evaluated true
|- align="left"
| Result|| Boolean || Out || Returns True on success, false on error
|}

==Usage==

This activity is typically used to find specific data within XML data, that was either provided by a ReadXPathDocument activity or by a previous GetXPathResult activity.
Given the powerful capabilities of XPath, this activity can be used to extract literally any data from any XML structure.

===Testing expressions===

To simplify the creation of a valid XPath expressions, this activity features an expandable designer that allows the testing of expressions against loadable XML files. Expand the activity in the designer canvas and click the button {{Key press|...}} to bring up a file open dialog, select a valid file and confirm with {{Key press|OK}}.
If the file was successfully loaded it will be displayed as a tree structure directly in the dsigner. You can now start typing XPath expressions in the Expression box, they will be evaluated immediately as you type and return the filtered result in the tree view.

==Example==

Evaluate the following XML file against all elements that are named SAPObject:


{| class="wikitable" | width = "50%"
|-
! Argument!! Value
|- align="left"
| XPathDocument||
|- align="left"
| XPathExpression || <source lang = "vbnet">"C:\temp\test.xml"</source>
|}

==See also==
* [[Workflow Designer]]
* [[Activity ReadXPathDocument]]

[[Category:Workflows]] [[Category:Activities]] [[Category:Data Exchange]]