[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XSL returning only unique (non-duplicate) nodes
I am trying to use XSL to filter out all repeated records from a source XML file below, so that I will only be working with a single instance of a given show @id when i use the following <xsl:variable name="unique-list" select="//seminars/seminar[@nodeid=$nodeid]/schedule/show/@id[not(.=precedin g::schedule/show/@id)]" /> I am able to get the correct 3 elements for @nodeid="1", but if I set @nodeid="2", I get 0 elements and when i reverse it (change preceding:: to following::) <xsl:variable name="unique-list" select="//seminars/seminar[@nodeid=$nodeid]/schedule/show/@id[not(.=followin g::schedule/show/@id)]" /> I get the opposite, 3 elements for @nodeid="2", but if I set @nodeid="1", I get 0 elements note: $nodeid is a <xsl:parameter> set to either 1 or 2 how do I limit the following:: and preceding:: to only look in the path that I am specifying --> //seminars/seminar[@nodeid=$nodeid]/schedule/show <-- and not any other part of hte XML document? source XML file <seminars> <seminar nodeid="1"> <schedule><show id="intro"/></schedule> <schedule><show id="pmw"/></schedule> <schedule><show id="ib"/></schedule> <schedule><show id="pmw"/></schedule> </seminar> <seminar nodeid="2"> <schedule><show id="intro"/></schedule> <schedule><show id="ccr"/></schedule> <schedule><show id="ib"/></schedule> <schedule><show id="ccr"/></schedule> </seminar> </seminars> 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
|