View Single Post
  #1 (permalink)  
Old February 10th, 2014, 02:00 PM
timmy013 timmy013 is offline
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Group elements to new parent node

Hi there, I'm beginner learning xsl and I need help with xsl file to transform my original xml which looks like

Code:
<pod>
  <id>1</id>
  <mfp>
    <type>1</type>
    <val>10</val>
  </mfp>
  <mfp>
    <type>2</type>
    <val>12</val>
  </mfp>
  ....
</pod>
And I need to have new node MFPS which contain all mfp elements, like

Code:
<pod>
  <id>1</id>
  <MFPS>
    <mfp>
      <type>1</type>
      <val>10</val>
    </mfp>
    <mfp>
      <type>2</type>
      <val>12</val>
    </mfp>
  </MFPS>
</pod>
<pod>
<id>2</id>
<MFPS>
<mfp>...</mfp>
</MFPS>
</pod>...

Please help me how to solve this. Thanks

Last edited by timmy013; February 10th, 2014 at 02:03 PM..