I need to extract info from a HTTP web service which is serving XML as follows:
<results>
<parametros>
<param name="mode">xml</param>
</parametros>
<estacions>
<estacio id="72400" nom="Aeroport"/>
<estacio id="79600" nom="Arenys de Mar"/>
<estacio id="79404" nom="Badalona"/>
...
</estacions>
</results>
How can I get the ttribute values? For example id and nom attributes? Here's my dataconfig file, but I don't reach to see how to implement this situation.
<dataConfig>
<dataSource type="HttpDataSource" />
<document>
<entity name="slashdot"
pk="link"
url=http://_host_/xmlservice/"
processor="XPathEntityProcessor"
forEach="/estacions"
transformer="DateFormatTransformer">
<field column="idestacio" xpath="/estacio.id" commonField="true" />
<field column="nomestacio" xpath="/estacio.nom" commonField="true" />
</entity>
</document>
</dataConfig>
See here how you can use JavaScript transformer to manipulate values extracted with XPath.