Subject: Re: [xsl] Generating numbering for cross-references (LONG) From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 18 Oct 2001 07:39:50 -0400 |
In a typical research document, an author needs to make many cross-references. XML provides ID and IDREF attributes for this purpose, and lots of DTDs are written to make use of them. ... You cannot reach over to the relevant part of the tree (by ID) and pluck a copy of a number which has not yet been generated.
At the point where a reference is made, what is the XPath expression you need to generate the number which will be the value which will eventually get assigned to the target? ... What I find unbelievable is that no-one has yet done this. It must be one of the most common requirements in document processing, and without it, XSLT simply cannot be used to reproduce simple numeric cross-references like "see Figure 16" or <plug>bibliographic references like Kay[23]</plug> :-)
What have I missed?
... <xsl:text>See Construct </xsl:text> <xsl:for-each select="id(@idref)"> <xsl:call-template name="construct-number"/> </xsl:for-each> ...
At the point of definition: ... <xsl:text>Construct </xsl:text> <xsl:call-template name="construct-number"/> ...
<xsl:template name="construct-number"> ... <xsl:number ...> </xsl:template>
-- G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995) Web site: XSL/XML/DSSSL/SGML/OmniMark services, training, products. Book: Practical Transformation Using XSLT and XPath ISBN 1-894049-06-3 Article: What is XSLT? http://www.xml.com/pub/2000/08/holman/index.html Next public training (instructor-live, Internet-live, and web-based): -2001-10-22,11-01,11-02,11-05,11-19,11-21,12-03,12-05,12-09,12-10,12-19
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Generating numbering for , David Carlisle | Thread | Re: [xsl] Generating numbering for , Thomas B. Passin |
RE: [xsl] saxon vs. dom4j, memory m, Michael Kay | Date | RE: [xsl] Saxon custom extensions p, Michael Kay |
Month |