Subject: RE: [xsl] xinclude, temp trees, and keys From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Sat, 20 Nov 2004 19:57:58 -0000 |
> > <xsl:for-each-group select="//db:biblioref/@linkend" group-by="."> > > <xsl:if test="position() > 1">,%20</xsl:if> > > <xsl:text>'</xsl:text> > > <xsl:value-of select="."/> > > <xsl:text>'</xsl:text> > > </xsl:for-each-group> > > > > One reason is that for-each-group gives you more control > over ordering > > in > > the result than distinct-values (the order of the result of > > distinct-values > > is implementation-defined). > > So if in other contexts I need to be able to know the first > occurrence > of a unique value, then I want to be using the above approach? distinct-values() will give you the distinct values, in an arbitrary order, and it won't tell you where they came from. for-each-group has two advantages: firstly you can control the order in which the results are returned (e.g. "order of first appearance"), and secondly, rather than getting the actual distinct values, you can get the nodes that carry those values - the node that contains a citation, rather than the string-value of the citation. > As I thought about this more, then, it's starting to seem like I need > another pass: > > 1) xinclude content > 2) resolve citation references and include them > 3) work with temporary tree enhancing data where necessary > 4) pass off to main stylesheets for final rendering > > Does that seem right? You don't absolutely need to build a composite tree, but I suspect it will make your life easier. Michael Kay
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xinclude, temp trees, and, Bruce D'Arcus | Thread | Re: [xsl] xinclude, temp trees, and, Bruce D'Arcus |
Re: [xsl] xinclude, temp trees, and, Bruce D'Arcus | Date | Re: [xsl] XSLT Generated Text, Anton Triest |
Month |