...
XML Data <?xml version ="1.0"?> <root xmlns:h="http://www.w3.org/TR/html4/"> <main page="CV PF Main Page" > <h:title h:name="CV PF Title">CV >PF Title Text <h:datarow> <h:data h:initials="AD">Ali Dawson</h:data> <h:data h:initials="GP">Gary Parden</h:data> </h:datarow> </h:title> <title name="Non namespace Title">Non namespace Title Text</title> </main> </root>
HTML Data <html> <body nodename="Html Body"> <table> <tbody> <tr> <td initials="AD">Ali Dawson</td> <td initials="GP">Gary Parden</td> </tr> </tbody> </table> </body> </html>
...
Response Type | XPath Expression | Explanation |
---|---|---|
String | n/a | A String response should be referenced in the stream attribute expressions as in.value Note that in.value will contain the complete string data referenced above. |
XML | /root/main/h:title Note that the namspace prefix used here 'h' must be configured in the HTTP XML Namspaces form | This XPath expression will bring back all elements matching the xpath expression including the parent/grandparents and all child elements/subelements. i.e <root xmlns:h="http://www.w3.org/TR/html4/"> <main page="CV PF Main Page" > <h:title h:name="CV PF Title">CV >PF Title Text <h:datarow> <h:data h:initials="AD">Ali Dawson</h:data> <h:data h:initials="GP">Gary Parden</h:data> </h:datarow> </h:title> </main> </root> The following examples show how to reference the returned xpaths html/xml data structure in stream attribute expressions:-
Note the use of a $ instead of our usual : namespace notation. Note the use of a ^ to traverse to the immediate parent element. Note the use of the listToString function to handle multiple matching child elements/attributes. |
HTML | /html/body/table Note that namspaces are not supported in the Xpath expression for HTML response types | This XPath expression will bring back all elements matching the xpath expression including the parent/grandparents and all child elements/subelements. i.e <html> <body nodename="Html Body"> <table> <tbody> <tr> <td initials="AD">Ali Dawson</td> <td initials="GP">Gary Parden</td> </tr> </tbody> </table> </body> </html> The following examples show how to reference the returned xpaths html/xml data structure in stream attribute expressions:-
Note the use of a ^ to traverse to the immediate parent element. Note the use of the listToString function to handle multiple matching child elements/attributes. Note the use of the optional html <tbody> tags. If these are not in your html data, then phixflow will insert them to conform with the HTML standards. Therefore when using absolute XPath expressions, note that the tbody tags need to be included even if they are not present in the incoming HTML data. |
...
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:xmlns:company-com:message" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cvpf="urn:phixflow.message.com"> <soapenv:Body> <queryResponse> <result xsi:type="QueryResult"> <done>true</done> <queryLocator xsi:nil="true"/> <record xsi:type="cvpf:sObject"> <cv<pf:type>Account</cvpf:type> <cv<pf:Name>Company1</cvpf:Name> <cv<pf:CreatedDate>2013-10-31T11:26:21.000Z</cvpf:CreatedDate> </record> <record xsi:type="cvpf:sObject"> <cv<pf:type>Account</cvpf:type> <cv<pf:Name>Company2</cvpf:Name> <cv<pf:CreatedDate>2013-10-31T11:26:21.000Z</cvpf:CreatedDate> </record> <size>2</size> </result> </queryResponse> </soapenv:Body> </soapenv:Envelope>
...