Jump to: navigation, search

Difference between revisions of "Activity:GetXPathResult (Activity)"


(See also)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The GetXPathResult Activity evaluates an [http://en.wikipedia.org/wiki/XPath XPath] expression in [http://en.wikipedia.org/wiki/XML XML] data. This data is typically provided by the [[Activity ReadXPathDocument|ReadXPathDocument]] activity or a predecessing GetXPathResult activity.
+
The GetXPathResult Activity evaluates an [http://en.wikipedia.org/wiki/XPath XPath] expression in [http://en.wikipedia.org/wiki/XML XML] data. This data is typically provided by the [[Activity:ReadXPathDocument (Activity)|ReadXPathDocument]] activity or a predecessing GetXPathResult activity.
  
 +
= Description =
 
{{ActivityInfoBox
 
{{ActivityInfoBox
 
| title = Get XPath Result
 
| title = Get XPath Result
 
| name = GetXPathResult  
 
| name = GetXPathResult  
| image =  
+
| image = [[File:UI_Activity_GetXPathResult.png|220px]]
| imagecaption = Activity GetXPathResult  
+
| imagecaption = GetXPathResult (expanded)
 
| purpose = Evaluate an XPath expression
 
| purpose = Evaluate an XPath expression
 
| category = Data Exchange
 
| category = Data Exchange
Line 12: Line 13:
 
}}
 
}}
  
 
+
===Arguments===
 
+
 
+
 
+
 
+
 
+
==Argument==
+
  
 
{| class="wikitable sortable" | width = "50%"
 
{| class="wikitable sortable" | width = "50%"
 
|-
 
|-
! Arguments!! Type !! Direction !! Purpose  
+
! Argument!! Type !! Direction !! Purpose  
 
|- align="left"
 
|- align="left"
| XPathDocument|| String || In || The XML data to evaluate the expression on
+
| XPathDocument|| {{String_MSDN}} || In || The XML data to evaluate the expression on
 
|- align="left"
 
|- align="left"
| XPathExpression || String|| In || The XPath expression
+
| XPathExpression || {{String_MSDN}}|| In || The XPath expression
 
|- align="left"
 
|- align="left"
| XPathNavigator || XPathNavigator|| In || The XPathNavigator object to evaluate the expression on; overrules ''XPathDocument'' if set
+
| XPathNavigator || {{XPathNavigator_MSDN}}|| In || The XPathNavigator object to evaluate the expression on; overrules ''XPathDocument'' if set
 
|- align="left"
 
|- align="left"
| XPathResult || List<XPathNavigator>|| Out || All XML data as XPathNavigator objects where expression evaluated true
+
| XPathResult || List<{{XPathNavigator_MSDN}}>|| Out || All XML data as XPathNavigator objects where expression evaluated true
 
|- align="left"
 
|- align="left"
| Result|| Boolean || Out || Returns True on success, false on error
+
| Result|| {{Boolean_MSDN}} || Out || Returns True on success, false on error
 
|}
 
|}
  
==Usage==
+
===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.
 
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.
Line 45: Line 40:
 
If the file was successfully loaded it will be displayed as a tree structure directly in the designer. 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.
 
If the file was successfully loaded it will be displayed as a tree structure directly in the designer. 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==
+
=Example=
  
 
Evaluate the following XML file against all elements that are named SAPObject, independently of the hierarchy level they appear:
 
Evaluate the following XML file against all elements that are named SAPObject, independently of the hierarchy level they appear:
Line 98: Line 93:
 
| XPathExpression || <source lang = "vbnet">"//SAPObject"</source>
 
| XPathExpression || <source lang = "vbnet">"//SAPObject"</source>
 
|}
 
|}
 +
 +
<headertabs />
  
 
==See also==
 
==See also==
 
* [[Workflow Designer]]
 
* [[Workflow Designer]]
* [[ReadXPathDocument (Activity)]]
+
* [[Activity:ReadXPathDocument (Activity)]]
* [[ReadCSVDocument (Activity)]]
+
* [[Activity:ReadCSVDocument (Activity)]]
  
[[Category:Workflows]] [[Category:Activities]] [[Category:Interfacing]]
+
[[Category:XML]]

Latest revision as of 12:23, 23 February 2015

The GetXPathResult Activity evaluates an XPath expression in XML data. This data is typically provided by the ReadXPathDocument activity or a predecessing GetXPathResult activity.

[edit]

Description

Get XPath Result
Name GetXPathResult
Purpose Evaluate an XPath expression
Category Data Exchange
Returns True if successful
Version 2.1.15+

Arguments

Argument Type Direction Purpose
XPathDocument String In The XML data to evaluate the expression on
XPathExpression String In The XPath expression
XPathNavigator XPathNavigator In The XPathNavigator object to evaluate the expression on; overrules XPathDocument if set
XPathResult List<XPathNavigator> Out All XML data as XPathNavigator objects where expression evaluated true
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 ... to bring up a file open dialog, select a valid file and confirm with OK. If the file was successfully loaded it will be displayed as a tree structure directly in the designer. 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, independently of the hierarchy level they appear:

<SAPObject>
        <sapid>1234</sapid>
</SAPObject>

<SAPObject>
        <guid>68cfff15-e253-4bc5-9290-d7c0babbe093</guid>
        <descr>SAP 2 best description ever</descr>
        <name>SAP_2_UPDATED</name>
</SAPObject>

<CADObject>
        <cadid1>1234</cadid1>
        <cadid2>5678</cadid2>
</CADObject>

<Company>
        <name>kno</name>
        <ComosObject>
                <uid>A2NKM67ENE</uid>
                <name>FVB901.199</name>
                <description0>2-Wege-Regelventil132</description0>
                <description1>2-Way-Valve</description1>
                <ref_sap><sapid>1234</sapid></ref_sap>
                <ref_cad>
                        <cadid1>1234</cadid1>
                        <cadid2>5678</cadid2>
                </ref_cad>
                <ref_cad_guid>adcd84d3-02c8-4cd2-9a00-8a6183b3ac5e</ref_cad_guid>
                <rel_sap prop1="aaa" prop2="bbb">
                        <sapid>1234</sapid>
                </rel_sap>
                <rel_cad prop1="ccc">
                        <cadid1>1234</cadid1>
                        <cadid2>5678</cadid2>
                </rel_cad>
                <rel_sap_guid>68cfff15-e253-4bc5-9290-d7c0babbe093</rel_sap_guid>
        </ComosObject> 
</Company>
Argument Value
XPathDocument Connect this argument with a variable
XPathExpression
"//SAPObject"

See also