[xsl] Grouping multiple tags into one parent tag

Subject: [xsl] Grouping multiple tags into one parent tag
From: Chad Chelius <cchelius@xxxxxxxxxx>
Date: Sun, 15 Feb 2009 12:55:24 -0500
I have xml with a section structured like this:

<body>content here</body>
<body>content here</body>
<body>content here</body>

I'd like to change all of the body elements to <p> tags and group all of those original body elements (now <p> tags) into a parent element.

I've been using

  <xsl:template match="body">
       <field name="body">
           <xsl:apply-templates/>
       </field>

because the parent element needs to be <field name="body"> but each original body element needs to be converted to <p> tags.

Can anyone assist me with this?




chad


Current Thread