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.
<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
proceed.
Again, thanks for the help.
-----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
Wendell Piez
Sent: Monday, December 15, 2003 6:59 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Xref numbering test
Norma,
In this case, extend the logic David told you about to use templates
instead of a for-each:
<xsl:template match="xref">
<xsl:text>(See </xsl:text>
<xsl:apply-templates select="key('ids',@xrefid)" mode="xref"/>
<xsl:text>.)</xsl:text>
</xsl:template>
<xsl:template match="figure" mode="xref">
<xsl:text>Figure </xsl:text>
<xsl:number level="any"/>
</xsl:template>
<xsl:template match="step" mode="xref">
<xsl:text>Step </xsl:text>
<xsl:number level="multiple" from="chapter" format="1.1.1"/> <!-- or
whatever it's going to be --> </xsl:template>
...so you use templates to sort out the different types of reference
targets. (A good reference book will give you details on fancy ways to
use
xsl:number.)
Cheers,
Wendell
At 02:01 PM 12/15/2003, you wrote:
Is there a way to test what element my xref is pointing to, or can I
test the xrefid with a wild card?
In my xref I test the attribute type and if it is figure I type the
word Fig. and number it.
If it is step I type the word step but here is where I need more.
Depending on the step element the numbering would be different.
<step1 id="step1-10">
<title>This is a sample title for a step 1</title> <para>This is a step
2 reference to <xref xrefid="step2-11"
xidtype="step"></xref>.</para>
</step1>
<step2 id="step2-11">
<title>This is a sample title for a step 1</title> <para>This is a step
1. <xref xrefid="step1-10"
xidtype="step"></xref>.</para>
</step2>
If it is a step1 then numbering would be format 1 If it is a step2 then
numbering would be format 1.1 and so on
<xsl:template match="xref">
<xsl:choose>
<xsl:when test="@xidtype='step'">
<fo:basic-link background-color="lightblue"
internal-destination="{(_at_)idref}">
<xsl:for-each select="key('ids',@xrefid)"> <xsl:text>Step </xsl:text>
<xsl:number count="step1|step2" from="mainfunc|closeup"
level="multiple"
format="1.1.1.1"/>
</xsl:for-each>
</fo:basic-link>
</xsl:when>
Hope this makes sense! Any suggestions will be appreciated.
Thanks
Confidentiality Notice
The information contained in this e-mail is confidential and intended
for use only by the person(s) or organization listed in the address. If
you have received this communication in error, please contact the
sender at O'Neil & Associates, Inc., immediately. Any copying,
dissemination, or distribution of this communication, other than by the
intended recipient, is strictly prohibited.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
======================================================================
Wendell Piez
mailto:wapiez(_at_)mulberrytech(_dot_)com
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
Confidentiality Notice
The information contained in this e-mail is confidential and intended for use
only by the person(s) or organization listed in the address. If you have
received this communication in error, please contact the sender at O'Neil &
Associates, Inc., immediately. Any copying, dissemination, or distribution of
this communication, other than by the intended recipient, is strictly
prohibited.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list