XML : How can i get a sequence of elements with a defined level into an element structure?

How ca i use an xslt template to get from this:

  <attribute name="Foo" level="1"/>  <attribute name="Bar" level="2"/>  <attribute name="Lorem" level="2"/>  <attribute name="Ipsum" level="3"/>    

to a structure like this:

  <attribute name="Foo">      <attribute name="Bar">      <attribute name="Lorem">          <attribute name="Ipsum"/>      </attribute>  </attribute>    

I can use XSLT and XPATH 2.0 and i tried different things with grouping but i don't know how to get a recursion into it.

No comments:

Post a Comment