RE: [xsl] Numbered Elements

Subject: RE: [xsl] Numbered Elements
From: "Jack Cane" <jwcane@xxxxxxxxxxx>
Date: Mon, 5 May 2003 17:32:19 -0400
-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of cknell@xxxxxxxxxx
Sent: Monday, May 05, 2003 10:31 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: RE: [xsl] Numbered Elements

* -----Original Message-----
> From:     "Jack Cane" <jwcane@xxxxxxxxxxx>
> Sent:     Sun, 4 May 2003 22:54:11 -0400
> To:       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Subject:  RE: [xsl] Numbered Elements
> I anticipate at least three numbered elements: equations, figures, > and
tables. I believe that I will want to refer to one of them at
> a time, or (in a front-matter table) to all of those of one kind,
> in order of their numbers.
> Both cases will require the values of two attributes: that of
> the etd:RefElemType, and of the element number (in this case,
> the equation number). In the second case the caption of the
> figure or equation, or the table title will also be required.

I understand you to say that you will want three templates for these three
elements: equations, figures, and tables. With each of these three you will
want to do something with the "etd:RefElemType" and the "number" attributes
(note that "number" is in the document's default namespace). It isn't clear
what you ultimately want to do with the value of these attributes. All of
your template examples get to a point where they "apply-templates" and we
never see what those templates are supposed to output.

* Wherever it appears, the xref element is supposed to return <<Equation 3>>
as an inline link to the corresponding equation (figure, table, etc.).
<<Equation>> is the RefElemType attribute and <<3>> is the number of the
equation. If I understand xslt syntax correctly, <<apply-templates>> is the
way to output the value of the attribute. The output would read, for
example, <<As shown in Equation 3....>>, with a text hyperlink to allow the
user to find the reference easily.

I think you are also saying that you will want to process these elements
twice, once for a "front-matter table" and a second time which you haven't
	Correct, but the "second" time could be multiple times, as often as the
writer needs to refer to the item.
In order to do this you will have to have two templates for each element you
want to process twice. Each template will have a "mode" attribute which is
how the processor can distinguish between them. Then when you
"apply-templates" you will add a "mode" attribute that will tell the
processor which template you want to use for the match. So, for example, you
will use an attribute like this "mode='front-matter'":
Right; that sounds good.
<xsl:template match="etd:xRef" mode="front-matter">

will be processed when you "apply-templates" like this:

<xsl:apply-templates select="..." mode="front-matter" />

Charles Knell
cknell@xxxxxxxxxx - email

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread