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

Re: Grouping with keys

Subject: Re: Grouping with keys
From: "Silvia Liberto" <SLiberto@xxxxxx>
Date: Wed, 8 Feb 2006 15:48:36 +0100 (MET)
Re:  Grouping with keys
Hi Wendell and all,

thanks for helping, i know what you mean when you say i should try a simpler
solution, but i need this key! ;-)

so i have changed my syntax on the @use attribute for Programlisting.

> generate-id(preceding-sibling::p[pPr/pStyle/@val='Heading1'][1])

but it still doesn4t works!? i have no grouping effect?

i can4t find the reason, have you another idea?


<xsl:key name="prog" match="p[pPr/pStyle/@val='Programlisting']"

use="generate-id(preceding-sibling::p[pPr/pStyle/@val='Programlisting'][1])"/>
 

 <xsl:template match="p">
 <xsl:choose>			
		<xsl:when test="pPr/pStyle/@val='Heading1'">
			<title>
				<xsl:value-of select="r/t"/>
			</title>
		</xsl:when>
		<xsl:when test="pPr/pStyle/@val='Programlisting'">
	<programlisting>
			 <xsl:for-each select="key('prog',generate-id())">
				<xsl:value-of select="r/t"/>
			 </xsl:for-each>	 
		</programlisting>
		</xsl:when>
</xsl:choose>


</xsl:template>

</xsl:stylesheet>



XML:

<?xml version="1.0" encoding="UTF-8"?>
<!--<?mso-application progid="Word.Document"?>-->
<wordDocument>
	<body>
		<sect>
			<p>
				<pPr>
					<pStyle val="Heading1"/>
				</pPr>
				<r>
					<t>Erste Ueberschrift</t>
				</r>
			</p>
			<p>
				<pPr>
					<pStyle val="Programlisting"/>
				</pPr>
				<r>
					<t>&lt;HTML&gt;</t>
				</r>
			</p>
			<p>
				<pPr>
					<pStyle val="Programlisting"/>
				</pPr>
				<r>
					<t> &lt;HEAD&gt;</t>
				</r>
			</p>	
			<p>
				<pPr>
					<pStyle val="Programlisting"/>
				</pPr>
				<r>
					<t> &lt;BODY&gt;</t>
				</r>
			</p>	
		</sect>
	</body>
</wordDocument>




-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie

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.