[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Numbered Elements

Subject: RE: Numbered Elements
From: "Jack Cane" <jwcane@xxxxxxxxxxx>
Date: Mon, 5 May 2003 21:13:21 -0400
numbered elements xsl
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@Target=..., 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[@Target='etd:refElemID']" />
	<xsl:value-of select="xsl:number[@Target=etd:refElemID]"/>
</xsl:template>

jwc


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of cknell@xxxxxxxxxx
Sent: Monday, May 05, 2003 7:04 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: RE:  Numbered Elements

> -----Original Message-----
> From:     "Jack Cane" <jwcane@xxxxxxxxxxx>
> Sent:     Mon, 5 May 2003 17:32:19 -0400
> To:       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Subject:  RE:  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@xxxxxxxxxx - 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


Current Thread
  • RE: Numbered Elements, (continued)
      • Jack Cane - Sun, 4 May 2003 22:54:13 -0400 (EDT)
    • cknell - Mon, 5 May 2003 09:31:32 -0400 (EDT)
      • Jack Cane - Mon, 5 May 2003 17:32:31 -0400 (EDT)
    • cknell - Mon, 5 May 2003 18:04:25 -0400 (EDT)
      • Jack Cane - Mon, 5 May 2003 21:13:19 -0400 (EDT) <=
    • cknell - Tue, 6 May 2003 11:50:39 -0400 (EDT)

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.