[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL: multiple element come to single parent elemen

Subject: Re: XSL: multiple element come to single parent element
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Sun, 10 May 2009 19:30:32 +0200
Re:  XSL: multiple element come to single parent elemen
Selva Ganesh wrote:

<div class="LegEnactingText">
<p class="LegText">The Secretary</p>
<div class="LegEnactingText">
<p class="LegText">vfgdhdf dfhdsgh </p>
<div class="LegEnactingText">
<p class="LegText">dffsg gsdfg sdghds</p>
<div class="LegEnactingText">
<p class="LegText">sgg dgfg dgfgd</p>

What i need:

<enacting-text>The Secretary</enacting-text>
<enacting-text>vfgdhdf dfhdsgh </enacting-text>
<enacting-text>dffsg gsdfg sdghds</enacting-text>
<enacting-text>sgg dgfg dgfgd</enacting-text>

Write a template for the parent element of those div elements. The following assumes that is a 'body' element but you could of course change that as needed:


<xsl:output method="xml" indent="yes" />

    <xsl:template match="body">
        <xsl:apply-templates select="div[@class = 'LegEnactingText']/p"/>

    <xsl:template match="div[@class = 'LegEnactingText']/p">


	Martin Honnen

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.