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

RE: Muenchian Grouping with Position() Constraints

Subject: RE: Muenchian Grouping with Position() Constraints
From: "McDonald, Thomas" <Thomas.McDonald@xxxxxxxxxxxxxx>
Date: Fri, 13 Jun 2003 13:21:02 -0400
thomas p mcdonald
That almost did it, but there is something that doesn't work with the first
name.  Here is the xml/xsl

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:key name="x" match="name" use="lname"/> 	
	<xsl:output method="xml"/>	
	<xsl:template match="names">
		<names>
		<xsl:for-each
select="(name[generate-id(.)=generate-id(key('x',lname))])[position()&gt;3]"
> 
		<name> 
		<xsl:copy-of select="lname"/> 
		<first> 
		<xsl:copy-of select="key('x',lname)/fname"/> 
		</first> 
		</name> 
		</xsl:for-each>
		</names>
	</xsl:template>
</xsl:stylesheet> 




<names>
<name><lname>Aarron</lname><first>Hank</first></name>
<name><lname>Aarron</lname><first>Ted</first></name>
<name><lname>Aiken</lname><first>Joe</first></name>
<name><lname>Aiken</lname><first>Jill</first></name>
<name><lname>Appleby</lname><first>Joe</first></name>
<name><lname>Appleby</lname><first>Sarah</first></name>
<name><lname>Appleseed</lname><first>John</first></name>
<name><lname>Appleseed</lname><first>Susan</first></name>
<name><lname>Arson</lname><first>Joe</first></name>
<name><lname>Arson</lname><first>Bill</first></name>
<name><lname>Azzure</lname><first>Peg</first></name>
</names>

-----Original Message-----
From: David Carlisle
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Sent: 6/13/2003 10:22 AM
Subject: Re:  Muenchian Grouping with Position() Constraints


<xsl:key name="x" match="name" use="lname"/>

...

<xsl:for-each
select="(names/name[generate-id(.)=generate-id(key('x',lname))])[positio
n()&gt;3]">
<name>
<xsl:copy-of select="lname"/>
<first>
<xsl:copy-of select="key('x',lname)/fname"/>
</first>
</name>
</xsl:for-each>

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.