External Data XPath demo: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Yaron Koren (talk | contribs) m (Reverted edits by 193.62.194.253 (talk) to last revision by Yaron Koren) |
||
Line 6: | Line 6: | ||
|format=xml | |format=xml | ||
|use xpath | |use xpath | ||
|data=salutation=/letter/salutation,maxlength=/letter/title[2]/@maxlength,address=/letter/address[@translate='no'],url=/letter/weblink | |data=salutation=/letter/salutation,maxlength=/letter/title[2]/@maxlength,address=/letter/address[@translate='no'],url=/letter/weblink}} | ||
</pre> | </pre> | ||
{{#get_web_data:url=http://producthelp.sdl.com/SDL%20Trados%20Studio/client_en/sample.xml | {{#get_web_data:url=http://producthelp.sdl.com/SDL%20Trados%20Studio/client_en/sample.xml | ||
|format=xml | |format=xml | ||
|use xpath | |use xpath | ||
|data=salutation=/letter/salutation,maxlength=/letter/title[2]/@maxlength,address=/letter/address[@translate='no'],url=/letter/weblink | |data=salutation=/letter/salutation,maxlength=/letter/title[2]/@maxlength,address=/letter/address[@translate='no'],url=/letter/weblink}} | ||
'''Salutation:''' {{#external_value:salutation}} | '''Salutation:''' {{#external_value:salutation}} | ||
Line 23: | Line 20: | ||
'''URL:''' {{#external_value:url}} | '''URL:''' {{#external_value:url}} | ||
Latest revision as of 02:03, November 20, 2012
The following is a demonstration of the "use xpath" feature of the External Data extension, to get specific values from the XML using XPath notation.
Data is retrieved from this sample XML file, using the following call:
{{#get_web_data:url=http://producthelp.sdl.com/SDL%20Trados%20Studio/client_en/sample.xml |format=xml |use xpath |data=salutation=/letter/salutation,maxlength=/letter/title[2]/@maxlength,address=/letter/address[@translate='no'],url=/letter/weblink}}
Salutation: Dear Daniel,
Max length: 40
Address: Smithtown