Data templates and transformations > Data transformation process reference > Custom XPath functions for data transformation > tdt:document()

tdt:document()
This function provides access to an external XML source document.
Signature
<document> tdt:document(<string>)
<string>
Depending on the repository configuration you may also be able to use features provided by the StoryTeller repository framework like wd:, otmm: and resource:.
Example
Data source
<data/>
Expected result
<xkcd>
<item>
<title>Efficiency</title>
<link>http://xkcd.com/1445/</link>
</item>
<item>
<title>Cloud</title>
<link>http://xkcd.com/1444/</link>
</item>
<item>
<title>Language Nerd</title>
<link>http://xkcd.com/1443/</link>
</item>
<item>
<title>Chemistry</title>
<link>http://xkcd.com/1442/</link>
</item>
</xkcd>
Data template
<xkcd>
<item>
<title>?</title>
<link>?</link>
</item>
</xkcd>
Data transformation
<tdt:rule path="/xkcd/item">
<tdt:value key=".">tdt:document('http://xkcd.com/rss.xml')/rss/channel/item</tdt:value>
<tdt:value key="recurse">.</tdt:value>
</tdt:rule>
Compiled transformation (data instance)
<tdt:rule path="/xkcd/item">
<tdt:value key=".">tdt:document('http://xkcd.com/rss.xml')/rss/channel/item</tdt:value>
</tdt:rule>
<tdt:rule path="/xkcd/item/link">
<tdt:value key=".">link</tdt:value>
<tdt:value key="text()">text()</tdt:value>
</tdt:rule>
<tdt:rule path="/xkcd/item/title">
<tdt:value key=".">title</tdt:value>
<tdt:value key="text()">text()</tdt:value>
</tdt:rule>
OpenText StreamServe 5.6.2 Updated: 2018-01-26