[xsl] ? using xsl:number

Subject: [xsl] ? using xsl:number
From: waldron.Navix@xxxxxxxxxxx
Date: Thu, 24 Jul 2003 15:23:17 +0900
I'm still trying to find a way to use xsl:number for numbering my step-by-step
instructions. Maybe there is another way than using xsl:number though. Maybe
someone can tell me. Anyways, here's what I'm looking at.
For the sake of this discussion, here is an example XML:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="number.xsl"?>
<DOC>
    <TITLE>Automatic Counters</TITLE>
    <procedure1>
        <step><para>This is step 1 using xsl:number.</para></step>
        <step><para>This is step 2 using xsl:number.</para></step>
        <step><para>This is step 3 using xsl:number.</para></step>
        <step><para>This is step 4 using xsl:number.</para></step>
        <step><para>This is step 5 using xsl:number.</para></step>
        <step><para>This is step 6 using xsl:number.</para></step>
        <step><para>This is step 7 using xsl:number.</para></step>
        <step><para>This is step 8 using xsl:number.</para></step>
        <step><para>This is step 9 using xsl:number.</para></step>
        <step><para>This is step 10 using xsl:number.</para></step>
    </procedure1>

    <orderedlist>
        <listitem><para>This is step 1 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
        <listitem><para>This is step 2 using HTML ordered-list with &lt;li&gt;
element..</para></listitem>
        <listitem><para>This is step 3 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
        <listitem><para>This is step 4 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
        <listitem><para>This is step 5 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
        <listitem><para>This is step 6 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
        <listitem><para>This is step 7 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
        <listitem><para>This is step 8 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
        <listitem><para>This is step 9 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
        <listitem><para>This is step 10 using HTML ordered-list with &lt;li&gt;
element.</para></listitem>
    </orderedlist>
</DOC>

And here is an XSLT for the above:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html"/>


<xsl:template match="DOC">
    <xsl:apply-templates />
</xsl:template>

<xsl:template match="TITLE">
    <h2>
        <xsl:apply-templates />
    </h2>
</xsl:template>

<xsl:template match="procedure">
    <blockquote>
        <xsl:apply-templates />
    </blockquote>
</xsl:template>

<xsl:template match="step">
    <h3 style="font-family:Arial, Sans Serif; font-weight:bold">
        <xsl:number format="1 " />
        <xsl:apply-templates />
    </h3>
</xsl:template>

<xsl:template match="//step/para">
    <span style="font-family:Times, Serif; font-weight:normal; font-size:10.5pt
">
        <xsl:apply-templates />
    </span>
</xsl:template>

<xsl:template match="orderedlist">
    <ol>
        <xsl:apply-templates />
    </ol>
</xsl:template>

<xsl:template match="//listitem/para">
    <li>
        <xsl:apply-templates />
    </li>
</xsl:template>


</xsl:stylesheet>

And so the question is...
Is there a way to use xsl:number so that the Procedure section has the same
vertical
alignment as the ordered numbering list below it?
(minus the periods though...)
Is there a different method than xsl:number that can be setup so there is no
offset
indentation of the text from step 9 to 10?
I'd be happy to just use the ol and li tags in html, but I don't want the
periods.
Thanks in advance for any help.

Dee Waldron
Tokyo, Japan



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


Current Thread