RE: [xsl] Xref numbering test

Subject: RE: [xsl] Xref numbering test
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 16 Dec 2003 14:34:51 -0500

At 07:14 AM 12/16/2003, you wrote:
Thanks for reply but maybe I didn't make want I want clear.
The xref has a xidtype of step but my elements are step1 step2 step3.
I need to know whether the step is a step1 or step2 etc. in order to
number it correctly.

If you have distinct templates for each type of step:

<xsl:template match="step1" mode="xref">
  Numbering for step1...</xsl:template>

<xsl:template match="step2" mode="xref">
  other numbering for step2...</xsl:template>

all you need to do is select the target node of your xref (using id() or key(), the same way you would do if there were only one type of target) and apply templates to it in this mode. The templates will sort out which one is which, without having to test explicitly (the template matching does the testing) -- all you need is the correspondence between @xrefid in the xref and @id (or whatever) on the target node.

I'm sorry this was not made clearer in my post.

Also, xsl:number provides support directly for hierarchical numbering a la "1.4.2": you might want to look into this further if you aren't aware of it already (why reimplement it?).


<xref xrefid="step1-10" xidtype="step"></xref>

The xrefid includes the step level a dash and increments
If I could test the id or test the element being referenced then I could

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

XSL-List info and archive:

Current Thread