Flatten XML using xstl

AndrewFive

New Member
I have:\[code\]<nodes> <node> <name>node1</name> <other>stuff1</other> <node> <name>node11</name> <other>stuff11</other> </node> <node> <name>node12</name> <other>stuff12</other> </node> </node> <node> <name>node2</name> <other>stuff2</other> </node> <node> <name>node3</name> <other>stuff3</other> </node></nodes>\[/code\]I want to end up with a flat structure like:\[code\]<nodes> <node> <name>node1</name> <other>stuff1</other> </node> <node> <name>node11</name> <other>stuff11</other> </node> <node> <name>node12</name> <other>stuff21</other> </node> <node> <name>node2</name> <other>stuff2</other> </node> <node> <name>node3</name> <other>stuff3</other> </node></nodes>\[/code\]This is a simple example but I want to copy all elements in each node, but not the nested 'node' elements. I tried the copy-of to preserve the tags but that also preserves the nesting. I also tried copy but that leaves out all children.Any ideas?
 
Back
Top