[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: select distinct
At 00/12/15 16:45 -0800, Richard Lander wrote:
I will mention that the elements are not all siblings. Some are, some are further down. The input looks like: You can use the Meunchen method as follows to find all like type attributes in the document scope: <xsl:key name="typeatts" match="x" use="@type"/> ... <xsl:for-each select="//x[generate-id(.)= generate-id(key(typeatts,@type))]"> <A href="javascript:element('{@type}')"> <xsl:value-of select="@type"/> </A> </xsl:for-each> If you need to subset this within a subtree then you can incorporate into the key value the generated id of the apex of the subtree: <xsl:key name="typeatts" match="x" use="concat( generate-id(ancestor::y),' ',@type )"/> and change the predicate accordingly. I hope this helps (the fragment above is untested so I may have mistyped). ............. Ken -- G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995) Web site: XSL/XML/DSSSL/SGML services, training, libraries, products. Book: Practical Transformation Using XSLT and XPath ISBN1-894049-05-5 Article: What is XSLT? http://www.xml.com/pub/2000/08/holman Next public instructor-led training: 2001-01-27,2001-02-21, - 2001-02-27/03-01,2001-03-05/07,2001-04-06/07,2001-05-01 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|