xsl-list
[Top] [All Lists]

Re: xsl:key, multiple conditions on sub elements

2005-10-28 14:37:41

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[(_at_)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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>