Help with iterating through XML

admin

Administrator
Staff member
Hi,

I have the following XML, this is just the first part but it continue for many rows.

This is produced by another tool.
There is a first set of nodes as follows. Then this set of nodes is repeated futher down within a set of translation nodes.

<name>
<tooltip>
<description>

My task is to take the content of the first set of nodes and copy it into the nodes with the translation nodes. Can anyone give me any suggestions about how to go about this. I have tried some Javscript with loadxml but am having problems with some of the nodes being empty. Also when the nodes are empty the XML is <footnote/>. Is this valid XML? Does DOM recognize this?

<translations language="ET" country="EE">

<items type="car">
<item id="345aa894-9e5a-41ea-b76b">
<name>GS 300</name>
<tooltip>GS 300</tooltip>
<description>
GS 300. 3.0 litre V6 VVT-i petrol, 6 speed automatic
</description>
<footnote/>
<translation>
<name/>
<tooltip/>
<description/>
<footnote/>
</translation>
</item>

<item id="e518c947-f9f9-4eb5-90be">
<name>GS 430</name>
<tooltip>GS 430</tooltip>

<description>
GS 430. 4.3 litre V8 VVT-i petrol, 6 speed automatic
</description>
<footnote/>

<translation>
<name/>
<tooltip/>
<description/>
<footnote/>
</translation>
</item>

thanks for any help,
 
Back
Top