|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Generating numbering for cross-references (LONG)
Peter,
What about something like: <xsl:template match="ref"> <xsl:apply-templates select="id(@to)" mode="ref-label"/> </xsl:template> <xsl:template match="section" mode="ref-label"> <xsl:text>Section </xsl:text> <xsl:number level="multiple" format="1.1.1"/> </xsl:template> and so forth? For many cases, a for-each could also be used to change context and generate the number, instead of a call to another template with a mode. Cheers, Wendell At 09:06 PM 10/17/01, you wrote: 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. I'm having a problem instatiating three classes of numeric cross-reference in XSLT, namely: That's serial thinking: let the processor go ahead and do it! ******************************************************************** 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? ******************************************************************** Why use XPath? it's for traversing trees. Using it to generate numbers for our output is just something we do to enhance processing, when our case is simple enough not to be worth the overhead of <xsl:number/>. References can be scattered (randomly distributed) through the document, so <xsl:number> cannot be used at the point of reference as it can be at the target, as it presupposes sequence. Not so. It's performance is poor precisely because it does not presuppose sequence of processing, only that the original document has an order. I think your XPath is trying to reimplement xsl:number, which is unnecessary. Or have *I* missed something? (I do this kind of cross-referencing all the time. :-). Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 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 ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








