[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: First Occurance Problem
David, > me > <xsl:copy-of select="(agg2/tag1[string(.)])[1]"/> > > Jeni > <tagx> > <xsl:value-of select="(agg2/tag1[string(.)])[1]" /> > </tagx> > > Note that the ( )[1] is requrired in my version (with copy-of) but > isn't actually needed in Jeni's (with value-of) as that always just > takes the value of the first node in document order. > > Jeni's either just making it explicit for pedagogical reasons, or > preparing us all for XSLT2 where the first node semantics will be > replaced by returning a sequence of all values if I recall > correctly. I was making it explicit for pedagogical reasons. XSLT 2.0's <xsl:value-of> will still act as it does in XSLT 1.0; it's only if you add a separator attribute that it creates a text node in which all the string values of the items in the sequence are included, separated by the string specified in the sequence attribute, e.g.: <xsl:value-of select="(1, 2, 3)" /> => "1" <xsl:value-of select="(1, 2, 3)" separator=" " /> => "1 2 3" <xsl:value-of select="(1, 2, 3)" separator"" /> => "123" Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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
|