I need to transform large XML files that have a nested (hierarchical) structure of the form
Flat XML
Hierarchical XML (multiple blocks, so
Given the following XML:
123 A Street
28
List of previous jobs in the US
3
01/10/2001
38
01/12/2004
6
01/06/2005
10
List of previous jobs in the UK
2
01/05/1999
25
01/07/2001
3
true
6
The following XSLT:
Gives the following output:
Note that I've added an Output root element to ensure the document is well formed.
Is this what you wanted?
You might also be able to use xsl:copy to copy the higher level elements, but I need to think about this one a bit more. With the above xslt, you have more control, but also you have to redefine your elements...