Query XML Action
Execute a XPath Expression on a XML-String
1.Add “Query XML” Action to a SharePoint Designer 2010 Workflow
2. Configure the action
XML: The XML String to query
XPath: The XPath expression
Selection Type: Defines what should be selected (Inner XML, Outer XML, Value)
Output: The result of the XPath Query. When the expression returns more than one node each node will be append to the result string. E.g. “<Node>1</Node><Node>2</Node><Node>3</Node>”. This would not be
valid XML and could not processed with the Query XML Action. To generate valid XML again surround the nodes with a root node with the Build Dynamic String Action.
Example 1: Simple XML without Namespaces
Example 1: Atom XML with Namespaces
Do a Twitter Search. Select all tweet titles and write them to history log:
Click the URL to see how the XML-Result from the HTTP-Request looks like
To select the title of the tweets we use the following XPath Expression:
When the XML contains namespaces use “local-name” in XPath Expression!
3. Publish and run the workflow