XSLT to select elements that don't match something?

xbanx

New Member
I have the following XML :- \[code\]<inventory> <item> <name_element> <!--some structure--> </name_element> <some_element1>val1</some_element1> <some_element2>val2</some_element2> <!-- some more elements --> </item> <!-- lots of items --></inventory>\[/code\]Now I want to convert this to :- \[code\]<inventory> <item some_element1="val1" some_element2="val2" ... > <name_element> <!-- as it is --> </name_element></inventory>\[/code\]Basically I don't know anything about the names/types of some_elements and any item could have any number of these elements. I do know that they are all simple types and convertible to attributes. I've read Converting XML elements to XML attributes using XSLT which tells how I can convert all child elements to attributes but it's not clear from that how I could exclude a specific 'name_element' from being converted to an attribute.
 
Back
Top