Skip to main content
Version: 2.17.x.x LTS

XmlDataSource

The XmlDataSource is used to read an XML document from a filer. An iterator XPath expression is used to define the elements in the document over which the XmlDataSource loops. For each of these elements multiple XPath expressions are evaluated to extract the data fields.

Configuration

NameType, usage constraints, defaultsDescription
filenamerequired: paraVal
default: none
type: file
The file to read the XML document from.
iteratoroptional: paraVal
default: //return
type: xpath
Defines the nodes in the document over which the XmlDataSource iterates. The current node in the XPath expression is the document root.The default value //return can be used for JAX-WS services which name their return element return.
datarequired: paraMap
default: none
type: string/xpath
Defines the event's data fields using XPath queries. The current node in the XPath queries is the node the iterator expression points to.
xpathNamespacesoptional: paraMap
default: none
type: string/string (uri)
Register namespace prefixes to the specified URIs. Those prefixes are used to parse the XPath expressions. The URIs specified have to match the URIs in the XML document.

Example

<dataSource type="XmlDataSource">
<dp:paraVal name="filename" value="/path/to/file.xml"/>
<!-- loop over person tags -->
<dp:paraVal name="iterator" value="//person" />
<dp:paraMap name="data">
<value name="id" value="./@id" /> (mailto:@id)
<value name="firstname" value="./firstName/text()" />
<value name="lastname" value="./lastName/text()" />
<value name="email" value="./email/text()" />
</dp:paraMap>
</dataSource>