Re: [xsl] Stumped on XPath

Subject: Re: [xsl] Stumped on XPath
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 13 Feb 2006 17:33:40 -0500

At 04:27 PM 2/13/2006, you wrote:
Ok, I seem to have got it. I changed the key to read <xsl:key name="r"
match="appendix" use="refnote/@id"/>... After testing 5 or 6 test
scenarios it's giving me exactly what I want. Thank you both so much
for the help.

That works -- retrieve the appendix itself, not the refnote, and get the number for that.

But the key will also work as you had it, retrieving the refnote, if your code

<xsl:for-each select="key('r',@ref)">
  <xsl:text> (see Appendix </xsl:text>
  <xsl:number format="A"/>
<xsl:text>) </xsl:text>

simple said <xsl:number format="A" from="appendix"/>. In that case, rather than traversing to the appendix containing a refnote (using the @id values of the refnotes inside each appendix to get it, as your key declares), you'd traverse to the refnotes and then just generate a number reflecting its appendix.

In that case you might actually have to say count="appendix" as well as from="appendix" (the memory blurs), so maybe it's good that you fell into the other solution.


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Current Thread