M
Mike N.
totally new to xml and xtml, but I have been able to do some basic
transforms such as move through he source xml doc and copy selected
elements and attributes. I am hung up though on the following:
I have a poorly formed xml document with an element called misc, this
element has a couple hundred attributes. I am trying to iterate
through this list of attributes and copy certain of these which match
a text pattern (I need a wildcard to finish the pattern, i.e.
"motorcycle_*") to another element which already has it's own nodes.
Source.xml
<sample>
....
<vehicles>
<motorcycle speed="140" wheels="2" handling="45.0" />
<car speed="100" wheels="4" handling="45.0" />
<truck speed="80" wheels="12" handling="45.0" />
<vehicles>
....
<misc truck_engine = "diesel" car_acceleration = "20"
motorcycle_acceleration = "20" motorcycle_engine = "electric"
car_engine = "gasoline" truck_acceleration = "10"/>
....
<sample>
what I want to do is end up with:
<motorcycle speed="140" wheels="2" handling="45.0"
motorcycle_acceleration = "20" motorcycle_engine = "electric" />
The source doc above is a very much simplified form, as said, misc has
hundreds of attributes, but I can match to them if I can do a string
match like "motorcycle_*"
I can get the motorcycle element and it's attributes using copy-of,
but that seems to keep me locked from being able to then add
additional attributes to it.
Thanks in advance to any who can help.
transforms such as move through he source xml doc and copy selected
elements and attributes. I am hung up though on the following:
I have a poorly formed xml document with an element called misc, this
element has a couple hundred attributes. I am trying to iterate
through this list of attributes and copy certain of these which match
a text pattern (I need a wildcard to finish the pattern, i.e.
"motorcycle_*") to another element which already has it's own nodes.
Source.xml
<sample>
....
<vehicles>
<motorcycle speed="140" wheels="2" handling="45.0" />
<car speed="100" wheels="4" handling="45.0" />
<truck speed="80" wheels="12" handling="45.0" />
<vehicles>
....
<misc truck_engine = "diesel" car_acceleration = "20"
motorcycle_acceleration = "20" motorcycle_engine = "electric"
car_engine = "gasoline" truck_acceleration = "10"/>
....
<sample>
what I want to do is end up with:
<motorcycle speed="140" wheels="2" handling="45.0"
motorcycle_acceleration = "20" motorcycle_engine = "electric" />
The source doc above is a very much simplified form, as said, misc has
hundreds of attributes, but I can match to them if I can do a string
match like "motorcycle_*"
I can get the motorcycle element and it's attributes using copy-of,
but that seems to keep me locked from being able to then add
additional attributes to it.
Thanks in advance to any who can help.