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

Re: for-each-group not working

Subject: Re: for-each-group not working
From: "Vasu Chakkera" <vasucv@xxxxxxxxx>
Date: Mon, 24 Nov 2008 15:10:48 +0000
Re:  for-each-group not working
Hmm. What Andrew Suggested Seemed Correct to me.
Anyway,
Try this Stylesheet. This produced the output you wanted..,
	<xsl:output method="xml" indent="no" encoding="iso-8859-1"
omit-xml-declaration="yes" />
	<xsl:template match="html">
		<projekt>
			<xsl:apply-templates/>
		</projekt>
	</xsl:template>
	<xsl:template match="body">
		<werk>
			<xsl:for-each-group select="*"
group-starting-with="p[contains(@class,'indexmain')]">
				<index-eintrag>
					<xsl:apply-templates select="current-group()"/>
				</index-eintrag>
			</xsl:for-each-group>
		</werk>
	</xsl:template>
	<xsl:template match="p[@class = 'indexsecond']">
		<index-eintrag1>
			<xsl:value-of select = "."/>
		</index-eintrag1>
	</xsl:template>
</xsl:stylesheet>


On Mon, Nov 24, 2008 at 12:48 PM, V.Ramkumar
<v.ramkumar@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> No index is the part of common attribute value for 3-levels.
> Primary/secondary/tertiary like index. Based on the this only I am checking.
>
> Regards,
> Ramkumar
>
>
> -----Original Message-----
> From: Andrew Welch [mailto:andrew.j.welch@xxxxxxxxx]
> Sent: Monday, November 24, 2008 5:06 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  for-each-group not working
>
>> I am using saxon9 for xml transformation. In this, for-each-group not
>> working fine. So please anyone find my errors.
>
> :)
>
>> My HTML (input),
>> <html>
>> <body>
>> <p class="indexmain"><em>Slogan main</em> 158</p>
>> <p class="indexsecond"><em>Slogan</em> 158</p>
>> <p class="indexsecond"><em>Slogan</em> 158</p>
>> <p class="indexsecond"><em>Slogan</em> 158</p>
>> <p class="indexsecond"><em>Slogan</em> 158</p>
>> <p class="indexmain"><em>Slogan main</em> 158</p>
>> <p class="indexsecond"><em>Slogan</em> 158</p>
>> <p class="indexsecond"><em>Slogan</em> 158</p>
>> <p class="indexsecond"><em>Slogan</em> 158</p>
>> <p class="indexmain"><em>Slogan main</em> 158</p>
>> </body>
>> </html>
>>
>
>><xsl:for-each-group select="*"
> group-starting-with="p[contains(@class,'index')]">
>
> You have:
>
> group-starting-with="p[contains(@class,'index')]"
>
> but that's true for all of them, so I think you meant:
>
> group-starting-with="p[contains(@class,'indexmain')]"
>
>
>
>
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/
>
>



-- 
Vasu Chakkera
Numerical Algorithms Group Ltd.
Oxford
www.vasucv.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.