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

Re: xsl:key, multiple conditions on sub elements

Subject: Re: xsl:key, multiple conditions on sub elements
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 28 Oct 2005 22:37:41 +0100
xsl key multiple match
> Is there a way to make the key select only "Associations" that have 
> aggregation="shared" and type="xxx" in the _same_ child element of the
> "Association"?


You have 

<xsl:key name="childassociations"
match="//UML:Association[UML:Association.connection/UML:AssociationEnd/@aggregation='shared']"
use="UML:Association.connection/UML:AssociationEnd/@type"/>

(by  the way you never need to start a match pattern with // :it doesn't
do much in a match template and doesn't do anything at all in a key.)

That says match on Association that have a grandchild with the shared
attribute, and index them by the type attribute of (any) AssociationEnd
grandchild.

If I understand you correctly, you just want 

<xsl:key name="childassociations"
match="UML:Association"
use="UML:Association.connection/UML:AssociationEnd[@aggregation='shared']/@type"/>

as that indexes the ones you want with the type attriibute (and
everything else with "", you could add the filter back to the match
pattern so you only index the ones that you actually need but..)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. 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
________________________________________________________________________

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.