p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 (http://p2p.wrox.com/forumdisplay.php?f=398)
-   -   Group elements to new parent node (http://p2p.wrox.com/showthread.php?t=92158)

timmy013 February 10th, 2014 02:00 PM

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


All times are GMT -4. The time now is 08:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.