Subject: RE: [xsl] Xref numbering test From: "Norma Yeazell" <Nyeazell@xxxxxxxxx> Date: Wed, 17 Dec 2003 09:58:21 -0500 |
Thanks for all the suggestions, here is how I made it work. I don't know if this is the best way but it works for my application. <xsl:when test="@xidtype='step'"> <fo:basic-link background-color="lightblue" internal-destination="{@idref}"> <xsl:for-each select="key('ids',@xrefid)"> <xsl:if test="substring(@id, 1, 6)='step1-'"> <xsl:text>Step </xsl:text> <xsl:number count="step1" from="mainfunc|closeup" level="multiple" format="1"/> </xsl:if> <xsl:if test="substring(@id, 1, 6)='step2-'"> <xsl:text>Step </xsl:text> <xsl:number count="step1|step2" from="mainfunc|closeup" level="multiple" format="1.1.1.1"/> </xsl:if> <xsl:if test="substring(@id, 1, 6)='step3-'"> <xsl:text>Step </xsl:text> <xsl:number count="step1|step2|step3" from="mainfunc|closeup" level="multiple" format="1.1.1.1"/> </xsl:if> <xsl:if test="substring(@id, 1, 6)='step4-'"> <xsl:text>Step </xsl:text> <xsl:number count="step1|step2|step3|step4" from="mainfunc|closeup" level="multiple" format="1.1.1.1"/> </xsl:if> <xsl:if test="substring(@id, 1, 6)='step5-'"> <xsl:text>Step </xsl:text> <xsl:number count="step1|step2|step3|step4|step5" from="mainfunc|closeup" level="multiple" format="1.1.1.1"/> </xsl:if> </xsl:for-each> </fo:basic-link> </xsl:when> -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Andrew Welch Sent: Wednesday, December 17, 2003 3:49 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] Xref numbering test Wendell: > ><xsl:template match="step1|step2..."> > > <xsl:variable name="currentId" select="@id"/> > > <xsl:for-each select="$steps"> > > <xsl:value-of select="step[@id = $currentId]/@number"/> > > 1. This will only work when using XSLT 2.0, or a node-set extension > function, since ordinarily (in XSLT 1.0) you cannot iterate over, or > query into, a result-tree-fragment this way. True. But there's no need to spell *everything* out is there? Surely a point in the right direction is better than a 'cut and paste' in the long run... > 2. Even so, how is it better than simply calculating the number of > each step using the same <xsl:number count="step1|step2|..." ... > /> instruction, > where you need it? > > <xsl:template match="step1|step2..."> > <xsl:variable name="currentId" select="@id"/> > <xsl:for-each select="$steps"> > <xsl:value-of select="step[@id = $currentId]/@number"/> > ... > > could as easily be > > <xsl:template match="step1|step2..."> > <xsl:number count="step1|step2....| " .../> > > (Look ma, no variable.) I recognise the element names and have worked on this kind of dtd for a few years, so (I think) I know the requirements even if norma didn't quite spell them out :) I still stand by using variables in this situation, they really help maintaining and debugging the process involved. cheers andrew XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list Confidentiality Notice The information contained in this e-mail is confidential and intended for use only by the person(s) or organization listed in the address. If you have received this communication in error, please contact the sender at O'Neil & Associates, Inc., immediately. Any copying, dissemination, or distribution of this communication, other than by the intended recipient, is strictly prohibited. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Re: opinions on ease of u, kakridge | Thread | [xsl] Getting a distinct list of no, Manuel Holtgrewe |
Re: [xsl] Re: how to apply an XSL t, Fabrice Estiévenart | Date | Re: [xsl] Re: how to apply an XSL t, David Carlisle |
Month |