create child nodes from sibling nodes until a different sibbling occurs.

Posted by user364939 on Stack Overflow See other posts from Stack Overflow or by user364939
Published on 2010-06-11T21:23:31Z Indexed on 2010/06/11 21:32 UTC
Read the original article Hit count: 127

Filed under:
|
|

Hi does anyone know what the xsl would look like to transform this XML. There can be N nte's after pid and N nte's after pv1. The structure is guaranteed in that all nte that follows pid belongs to pid and all nte following pv1 belongs to pv1.

From:

<pid>
</pid>
<nte> 
  <nte-1>1</nte-1>
  <nte-3>Note 1</nte-1>
</nte>
<nte></nte>
<pv1></pv1>
<nte>
</nte>

into:

<pid>
  <nte> 
    <nte-1>1</nte-1>
    <nte-3>Note 1</nte-1>
  </nte>
  <nte>
  </nte>
</pid>
<pv1>
  <nte>
  </nte>
</pv1>

Thanks!

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xslt