xsl-list
[Top] [All Lists]

Re: Cross-reference not returning correct node

2005-08-13 10:56:26
Hi,
Tempore 19:34:10, die 08/13/2005 AD, hinc in 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Debbie Evans 
<devans(_at_)oneil(_dot_)com>:

when I try to cross reference to the table
number it only returns the text "Table" -- no number when using the
following:

<xsl:for-each select="key('tableids',@refid)">
<xsl:text>Table&#xA0;</xsl:text>
<xsl:number count="table//title" level="any" from="manual"/>
</xsl:for-each>

If the cross-referenced table in your test case happens to be the first table 
with a title, you will get no output indeed. That's because the current node is 
a table element. the 'xsl:number' will release it's counting algorithm on every 
node preceding-or-self from the current node (the title of the current table 
will thus not be counted). Since you were really counting titles instead of 
titled tables, no result would be obtained.

Try this:
<xsl:number count="table[.//title]" level="any" from="manual"/>

key: <xsl:key name="tableids" match="table[(_at_)id]" use="@id"/>

regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Ceterum censeo XML omnibus esse utendum

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>