xsl-list
[Top] [All Lists]

RE: Numbered Elements

2003-05-05 18:13:21
OK, got it; etd:refElemID and etd:refElemType are both being rendered in the
template. Only the <<element number>> remains hidden. I have two approaches,
one using the key element, as suggested by Michael Kay, and the other using
xsl:number(_at_)Target=(_dot_)(_dot_)(_dot_), your suggestion. I added the xsl: 
prefix, as you
indicated.

Any ideas appreciated, as always.

<xsl:key name="kEqn" match="Equation" use="Target" />

<xsl:template match="etd:xRef">
        <xsl:value-of select="@etd:refElemType"/>
        <xsl:text> </xsl:text><!-- a space character-->
        <xsl:value-of select="key('kEqn', '@etd:refElemID')"/>
        <xsl:text> </xsl:text><!-- a space character-->
        <xsl:value-of  select="xsl:number[(_at_)Target='etd:refElemID']" />
        <xsl:value-of select="xsl:number[(_at_)Target=etd:refElemID]"/>
</xsl:template>

jwc


-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com]On Behalf Of 
cknell(_at_)onebox(_dot_)com
Sent: Monday, May 05, 2003 7:04 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: RE: [xsl] Numbered Elements

-----Original Message-----
From:     "Jack Cane" <jwcane(_at_)enw-ltd(_dot_)com>
Sent:     Mon, 5 May 2003 17:32:19 -0400
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  RE: [xsl] Numbered Elements

If I understand xslt syntax correctly, <<apply-templates>> is the
way to output the value of the attribute.


<xsl:apply-templates /> tells the processor to work its way through the
current context and apply any templates that match elements it finds.

To output the value of an element or attribute, you will want to use the
<xsl:value-of select="" /> element. Taking from an earlier message in this
thread:

<etd:xRef etd:refElemID="FirstSum" etd:refElemType="Equation">
</etd:xRef>

If you have a template that matches <edt:xRef>, and inside that template you
wish to output the values of the two attributes of the context element, then
you should use these two elements:

<xsl:value-of select="@etd:refElemID" />
<xsl:value-of select="@etd:refElemType" />
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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