xsl-list
[Top] [All Lists]

Re: [xsl] Grouping multiple tags into one parent tag

2009-02-15 13:12:10
Thank you all for your responses. Ken this is exactly what I was trying to do! The only thing is, I am also using:

<xsl:output method="xml" cdata-section-elements="field"/>

To wrap the contents of the field element in a cdata tag. After using the template rule that you provided, that cdata-section-element no longer works. I'm not sure why.


<chad/>

Chad Chelius
Adobe Certified Instructor
Adobe Certified Expert
AGI Training
cchelius(_at_)aquent(_dot_)com

See me at the CRE8 Conference
www.CRE8summit.com
April 15-16 at the Walt Disney World Resort






On Feb 15, 2009, at 1:03 PM, G. Ken Holman wrote:

Re-reading your post, perhaps you meant the following:

 <xsl:template match="body">
   <xsl:if test="not(preceding-sibling::body)">
      <field name="body">
         <xsl:for-each select="../body">
            <p>
               <xsl:apply-templates/>
            </p>
         </xsl:for-each>
      </field>
   </xsl:if>
 </xsl:template>

This would produce:

 <field name="body">
   <p>content here</p>
   <p>content here</p>
   <p>content here</p>
 </field>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--