Loading ...
Sorry, an error occurred while loading the content.

cross referencing within a document using xref

Expand Messages
  • mina_hurray
    Hi: I am trying to cross reference within a document using xref. Here is my sample XML input: This is a step.
    Message 1 of 5 , Mar 19, 2007
    • 0 Attachment
      Hi:

      I am trying to cross reference within a document using xref. Here is
      my sample XML input:

      <level1 id="123">
      <text>This is a step.
      <level2 id="456">
      <text> Anther level </text>
      <level3 id="aaa">
      One more level inside level2.

      </level3>
      <level2>
      </level1>

      <level1 id=789">
      <text>This is a step which refers levels <xref xrefid="123"/><xref
      xrefid="456"/> through <xref xrefid="123"/><xref xrefid="aaaa"/>in the
      previous level1.
      <level2 id="1011">
      <text> Anther level2 </text>
      <level2>
      </level1>

      level1 is formattd with 1. and level 2 is formatted with a and level 3
      with i.

      So the putput should read:

      "This is a step which refers levels 1.a through 1.i. in the previous
      level1. "

      I have used <xsl:key> to refere to the ids of these levels using the
      statement:

      <xsl:key name="steps" match="*[@id]" use="@id"/>


      <xsl:template match="xref">
      <xsl:variable name="step" select="key('steps',@xrefid)"/>

      <xsl:for-each select="$step">

      <xsl:if test="name($step)='level1'">

      <xsl:number format="1"/>.</xsl:if>
      <xsl:if test="name($step)='level2'">

      <xsl:number format="a"/>.</xsl:if>
      <xsl:if test="name($step)='level3'">
      <xsl:number format="i"/>.</xsl:if>

      </xsl:for-each>


      </xsl:template>

      However,if I change the XML to point to the last level referenced,
      this code does not work. So if the XML input is changed to:


      <level1 id="123">
      <text>This is a step.
      <level2 id="456">
      <text> Anther level </text>
      <level3 id="aaa">
      One more level inside level2.

      </level3>
      <level2>
      </level1>

      <level1 id=789">
      <text>This is a step which refers levels <xref xrefid="456"/> through
      <xref xrefid="aaaa"/>in the previous level1.
      <level2 id="1011">
      <text> Anther level2 </text>
      <level2>
      </level1>

      My output with the XSLT changes to:

      "This is a step which refers levels a through i. in the previous level1. "

      Can anyone suggest a different approach to this issue?

      Thank you
    • G. Ken Holman
      ... The code you provided was not well formed and I guessed at the markup you needed. ... But since aaa is at level 3, by definition it should read 1.a.i
      Message 2 of 5 , Mar 19, 2007
      • 0 Attachment
        At 2007-03-19 16:28 +0000, mina_hurray wrote:
        >I am trying to cross reference within a document using xref. Here is
        >my sample XML input:

        The code you provided was not well formed and I guessed at the markup
        you needed.

        ><level1 id="123">
        ><text>This is a step.
        ><level2 id="456">
        ><text> Anther level </text>
        ><level3 id="aaa">
        >One more level inside level2.
        >
        ></level3>
        ><level2>
        ></level1>
        >
        ><level1 id=789">
        ><text>This is a step which refers levels <xref xrefid="123"/><xref
        >xrefid="456"/> through <xref xrefid="123"/><xref xrefid="aaaa"/>in the
        >previous level1.
        ><level2 id="1011">
        ><text> Anther level2 </text>
        ><level2>
        ></level1>
        >
        >level1 is formattd with 1. and level 2 is formatted with a and level 3
        >with i.
        >
        >So the putput should read:
        >
        >"This is a step which refers levels 1.a through 1.i. in the previous
        >level1. "

        But since "aaa" is at level 3, by definition it should read "1.a.i"
        and not "1.i" which is a two-level label. I'm not sure how that
        posited output would be correct, so I'll assume it was a
        typographical error in your post.

        >I have used <xsl:key> to refere to the ids of these levels using the
        >statement:
        >
        ><xsl:key name="steps" match="*[@id]" use="@id"/>

        Fine ... this is appropriate.

        > <xsl:template match="xref">
        ><xsl:variable name="step" select="key('steps',@xrefid)"/>
        >
        ><xsl:for-each select="$step">
        >
        > <xsl:if test="name($step)='level1'">
        >
        > <xsl:number format="1"/>.</xsl:if>
        > <xsl:if test="name($step)='level2'">
        >
        > <xsl:number format="a"/>.</xsl:if>
        > <xsl:if test="name($step)='level3'">
        > <xsl:number format="i"/>.</xsl:if>
        >
        > </xsl:for-each>
        >
        ></xsl:template>

        There are a number of issues in the above that are not appropriate,
        even if this was the only approach available (which it isn't). In
        XSLT you should never use the "name()" function for a "what am I?"
        test ... you should be using the self:: axis for such a test. And,
        when only one choice can be true from a set of choices, you should be
        using <xsl:choose> instead of <xsl:if>. And, because of the current
        node list you need not put nodes into a variable and reference the variable.

        The code fragment above is written from a programmer's perspective
        rather than from a stylesheet writer's perspective. I see this a lot
        in my training classes as programmers intuitively use constructs they
        are familiar with rather than trying to take advantage of the
        strengths of XSLT. Using such strengths makes for more robust code
        and more optimizable code. Optimization should be the responsibility
        of the XSLT engine and not the stylesheet writer.

        >However,if I change the XML to point to the last level referenced,
        >this code does not work.

        You would get a two-level link which is what you say in your
        sentence, but I agree you would not get a three-level link.

        >So if the XML input is changed to:
        >
        ><level1 id="123">
        ><text>This is a step.
        ><level2 id="456">
        ><text> Anther level </text>
        ><level3 id="aaa">
        >One more level inside level2.
        >
        ></level3>
        ><level2>
        ></level1>
        >
        ><level1 id=789">
        ><text>This is a step which refers levels <xref xrefid="456"/> through
        ><xref xrefid="aaaa"/>in the previous level1.
        ><level2 id="1011">
        ><text> Anther level2 </text>
        ><level2>
        ></level1>

        Again, that data is not well formed and the link anchor "aaaa" does
        not exist, but I've attempted to guess what you want.

        >My output with the XSLT changes to:
        >
        >"This is a step which refers levels a through i. in the previous level1. "
        >
        >Can anyone suggest a different approach to this issue?

        You will see in the code below that <xsl:number> is designed to
        create tumblers (multi-level numbering) and your answer is achieved
        with a single XSLT instruction for the labeling. What you are trying
        to achieve by hand is built into the specification.

        I hope this helps.

        . . . . . . . . . . . . Ken

        T:\ftemp>type mina.xml
        <test>
        <level1 id="123">
        <text>This is a step. </text>
        <level2 id="456">
        <text> Anther level </text>
        <level3 id="aaa">
        <text>One more level inside level2. </text>
        </level3>
        </level2>
        </level1>

        <level1 id="789">
        <text>This is a step which refers levels <xref xrefid="456"/> through
        <xref xrefid="aaa"/> in the previous level1. </text>
        <level2 id="1011">
        <text> Anther level2 </text>
        </level2>
        </level1>
        </test>
        T:\ftemp>type mina.xsl
        <?xml version="1.0" encoding="US-ASCII"?>
        <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        version="1.0">

        <xsl:output method="text"/>

        <xsl:key name="steps" match="*[@id]" use="@id"/>

        <xsl:template match="xref">
        <xsl:for-each select="key('steps',@xrefid)">
        <xsl:number level="multiple"
        count="level1 | level2 | level3"
        format="1.a.i"/>
        </xsl:for-each>
        </xsl:template>

        </xsl:stylesheet>

        T:\ftemp>xslt mina.xml mina.xsl con


        This is a step.

        Anther level

        One more level inside level2.





        This is a step which refers levels 1.a through
        1.a.i in the previous level1.

        Anther level2



        T:\ftemp>


        --
        World-wide corporate, govt. & user group XML, XSL and UBL training
        RSS feeds: publicly-available developer resources and training
        G. Ken Holman mailto:gkholman@...
        Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
        Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
        Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
        Legal business disclaimers: http://www.CraneSoftwrights.com/legal
      • ms
        Thank you very much Mr.Holman. Pardon me for my typos. I tried the code that you gave me and it worked. I have just one more question for you. I have mentioned
        Message 3 of 5 , Mar 19, 2007
        • 0 Attachment
          Thank you very much Mr.Holman. Pardon me for my typos.


          I tried the code that you gave me and it worked. I
          have just one more question for you. I have mentioned
          only three levels in this example. However, in my
          document I can have up to 6 levels.

          The formatting used is:

          level1 - 1
          level2 - A
          level3 - (1)
          level4 - (a)
          level5 - 1)
          level6 - a

          Now I modified the xref template format to:

          <xsl:template match="xref">
          <xsl:for-each select="key( 'steps',@ xrefid)">
          <xsl:number level="multiple"
          count="level1| level2 | level3|level4|level5|level6"
          format="1.A.(1).(a).1).a."/>

          </xsl:for-each>
          </xsl:template>
          Is this the correct way? I basically want to enforce
          the formatting numbers to be the same if a sixth level
          is referenced.
          So i want somehtinglike 1.C.(5).(a).1).a.

          If it is at a third level I want:

          1.C.(5).

          Please tell me if I what I am doing is right.


          Mina





          --- "G. Ken Holman" <gkholman@...>
          wrote:

          > At 2007-03-19 16:28 +0000, mina_hurray wrote:
          > >I am trying to cross reference within a document
          > using xref. Here is
          > >my sample XML input:
          >
          > The code you provided was not well formed and I
          > guessed at the markup
          > you needed.
          >
          > ><level1 id="123">
          > ><text>This is a step.
          > ><level2 id="456">
          > ><text> Anther level </text>
          > ><level3 id="aaa">
          > >One more level inside level2.
          > >
          > ></level3>
          > ><level2>
          > ></level1>
          > >
          > ><level1 id=789">
          > ><text>This is a step which refers levels <xref
          > xrefid="123"/><xref
          > >xrefid="456"/> through <xref xrefid="123"/><xref
          > xrefid="aaaa"/>in the
          > >previous level1.
          > ><level2 id="1011">
          > ><text> Anther level2 </text>
          > ><level2>
          > ></level1>
          > >
          > >level1 is formattd with 1. and level 2 is formatted
          > with a and level 3
          > >with i.
          > >
          > >So the putput should read:
          > >
          > >"This is a step which refers levels 1.a through
          > 1.i. in the previous
          > >level1. "
          >
          > But since "aaa" is at level 3, by definition it
          > should read "1.a.i"
          > and not "1.i" which is a two-level label. I'm not
          > sure how that
          > posited output would be correct, so I'll assume it
          > was a
          > typographical error in your post.
          >
          > >I have used <xsl:key> to refere to the ids of these
          > levels using the
          > >statement:
          > >
          > ><xsl:key name="steps" match="*[@id]" use="@id"/>
          >
          > Fine ... this is appropriate.
          >
          > > <xsl:template match="xref">
          > ><xsl:variable name="step"
          > select="key('steps',@xrefid)"/>
          > >
          > ><xsl:for-each select="$step">
          > >
          > > <xsl:if
          > test="name($step)='level1'">
          > >
          > > <xsl:number
          > format="1"/>.</xsl:if>
          > > <xsl:if
          > test="name($step)='level2'">
          > >
          > > <xsl:number
          > format="a"/>.</xsl:if>
          > > <xsl:if
          > test="name($step)='level3'">
          > > <xsl:number
          > format="i"/>.</xsl:if>
          > >
          > > </xsl:for-each>
          > >
          > ></xsl:template>
          >
          > There are a number of issues in the above that are
          > not appropriate,
          > even if this was the only approach available (which
          > it isn't). In
          > XSLT you should never use the "name()" function for
          > a "what am I?"
          > test ... you should be using the self:: axis for
          > such a test. And,
          > when only one choice can be true from a set of
          > choices, you should be
          > using <xsl:choose> instead of <xsl:if>. And,
          > because of the current
          > node list you need not put nodes into a variable and
          > reference the variable.
          >
          > The code fragment above is written from a
          > programmer's perspective
          > rather than from a stylesheet writer's perspective.
          > I see this a lot
          > in my training classes as programmers intuitively
          > use constructs they
          > are familiar with rather than trying to take
          > advantage of the
          > strengths of XSLT. Using such strengths makes for
          > more robust code
          > and more optimizable code. Optimization should be
          > the responsibility
          > of the XSLT engine and not the stylesheet writer.
          >
          > >However,if I change the XML to point to the last
          > level referenced,
          > >this code does not work.
          >
          > You would get a two-level link which is what you say
          > in your
          > sentence, but I agree you would not get a
          > three-level link.
          >
          > >So if the XML input is changed to:
          > >
          > ><level1 id="123">
          > ><text>This is a step.
          > ><level2 id="456">
          > ><text> Anther level </text>
          > ><level3 id="aaa">
          > >One more level inside level2.
          > >
          > ></level3>
          > ><level2>
          > ></level1>
          > >
          > ><level1 id=789">
          > ><text>This is a step which refers levels <xref
          > xrefid="456"/> through
          > ><xref xrefid="aaaa"/>in the previous level1.
          > ><level2 id="1011">
          > ><text> Anther level2 </text>
          > ><level2>
          > ></level1>
          >
          > Again, that data is not well formed and the link
          > anchor "aaaa" does
          > not exist, but I've attempted to guess what you
          > want.
          >
          > >My output with the XSLT changes to:
          > >
          > >"This is a step which refers levels a through i. in
          > the previous level1. "
          > >
          > >Can anyone suggest a different approach to this
          > issue?
          >
          > You will see in the code below that <xsl:number> is
          > designed to
          > create tumblers (multi-level numbering) and your
          > answer is achieved
          > with a single XSLT instruction for the labeling.
          > What you are trying
          > to achieve by hand is built into the specification.
          >
          > I hope this helps.
          >
          > . . . . . . . . . . . . Ken
          >
          > T:\ftemp>type mina.xml
          > <test>
          > <level1 id="123">
          > <text>This is a step. </text>
          > <level2 id="456">
          > <text> Anther level </text>
          > <level3 id="aaa">
          > <text>One more level inside level2. </text>
          > </level3>
          > </level2>
          > </level1>
          >
          > <level1 id="789">
          > <text>This is a step which refers levels <xref
          > xrefid="456"/> through
          > <xref xrefid="aaa"/> in the previous level1. </text>
          > <level2 id="1011">
          > <text> Anther level2 </text>
          > </level2>
          > </level1>
          > </test>
          > T:\ftemp>type mina.xsl
          > <?xml version="1.0" encoding="US-ASCII"?>
          > <xsl:stylesheet
          > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          > version="1.0">
          >
          > <xsl:output method="text"/>
          >
          > <xsl:key name="steps" match="*[@id]" use="@id"/>
          >
          > <xsl:template match="xref">
          > <xsl:for-each select="key('steps',@xrefid)">
          > <xsl:number level="multiple"
          >
          === message truncated ===




          ____________________________________________________________________________________
          Sucker-punch spam with award-winning protection.
          Try the free Yahoo! Mail Beta.
          http://advision.webevents.yahoo.com/mailbeta/features_spam.html
        • G. Ken Holman
          ... Close but there is a nuance that I neglected last time. You cannot easily get the trailing ) after the 5 because it is considered part of the prefix
          Message 4 of 5 , Mar 19, 2007
          • 0 Attachment
            At 2007-03-19 12:03 -0700, ms wrote:
            >I tried the code that you gave me and it worked. I
            >have just one more question for you. I have mentioned
            >only three levels in this example. However, in my
            >document I can have up to 6 levels.
            >
            >The formatting used is:
            >
            >level1 - 1
            >level2 - A
            >level3 - (1)
            >level4 - (a)
            >level5 - 1)
            >level6 - a
            >
            >Now I modified the xref template format to:
            >
            > <xsl:template match="xref">
            > <xsl:for-each select="key( 'steps',@ xrefid)">
            ><xsl:number level="multiple"
            >count="level1| level2 | level3|level4|level5|level6"
            >format="1.A.(1).(a).1).a."/>
            >
            ></xsl:for-each>
            > </xsl:template>
            >Is this the correct way? I basically want to enforce
            >the formatting numbers to be the same if a sixth level
            >is referenced.
            >So i want somehtinglike 1.C.(5).(a).1).a.
            >
            >If it is at a third level I want:
            >
            >1.C.(5).
            >
            >Please tell me if I what I am doing is right.

            Close but there is a nuance that I neglected last time. You cannot
            easily get the trailing ")" after the "5" because it is considered
            part of the prefix ")." to the "a". See the mina.xsl and mina.out
            below for the effect. Note that the trailing "." on level 3 is the
            "." at the end of the pattern.

            Since you have suffixes as well as prefixes in middle levels it will
            have to be more complex than a simple use of <xsl:number>. See
            mina2.xsl and mina2.out below for a complete solution. You will see
            that I was able to combine levels 1 and 2 because of the simple
            formatting, but I had to break out levels 3-6 because of the prefixes
            and suffixes.

            I hope this helps.

            . . . . . . . . . . . . . Ken


            t:\ftemp>type mina.xml
            <test>
            <level1 id="123">
            <text>This is a step. </text>
            <level2/>
            <level2/>
            <level2 id="234">
            <text> Anther level </text>
            <level3/>
            <level3/>
            <level3/>
            <level3/>
            <level3 id="345">
            <text>One more level inside level2. </text>
            <level4 id="456">
            <text>This is a step. </text>
            <level5 id="567">
            <text> Anther level </text>
            <level6 id="678">
            <text>One more level inside level5. </text>
            </level6>
            </level5>
            </level4>

            <level4 id="789">
            <text>This is a step which refers levels:</text>
            <xref xrefid="123"/>
            <xref xrefid="234"/>
            <xref xrefid="345"/>
            <xref xrefid="456"/>
            <xref xrefid="567"/>
            <xref xrefid="678"/>
            <level5>
            <text> Anther level5 </text>
            </level5>
            </level4>
            </level3>
            </level2>
            </level1>
            </test>



            t:\ftemp>type mina.xsl
            <?xml version="1.0" encoding="US-ASCII"?>
            <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            version="1.0">

            <xsl:output method="text"/>

            <xsl:key name="steps" match="*[@id]" use="@id"/>

            <xsl:template match="xref">
            <xsl:for-each select="key('steps',@xrefid)">
            <xsl:number level="multiple"
            count="level1 | level2 | level3 | level4 | level5 | level6"
            format="1.A.(1).(a).1).a."/>
            </xsl:for-each>
            </xsl:template>

            </xsl:stylesheet>


            t:\ftemp>call xslt mina.xml mina.xsl mina.out

            t:\ftemp>type mina.out


            This is a step.



            Anther level





            One more level inside level2.

            This is a step.

            Anther level

            One more level inside level5.





            This is a step which refers levels:
            1.
            1.C.
            1.C.(5.
            1.C.(5).(a.
            1.C.(5).(a).1.
            1.C.(5).(a).1).a.

            Anther level5






            t:\ftemp>type mina2.xsl
            <?xml version="1.0" encoding="US-ASCII"?>
            <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            version="1.0">

            <xsl:output method="text"/>

            <xsl:key name="steps" match="*[@id]" use="@id"/>

            <xsl:template match="xref">
            <xsl:for-each select="key('steps',@xrefid)">
            <xsl:choose>
            <xsl:when test="self::level1 or self::level2">
            <xsl:number level="multiple"
            count="level1 | level2"
            format="1.A."/>
            </xsl:when>
            <xsl:when test="self::level3">
            <xsl:number level="multiple"
            count="level1 | level2 | level3"
            format="1.A.(1)."/>
            </xsl:when>
            <xsl:when test="self::level4">
            <xsl:number level="multiple"
            count="level1 | level2 | level3 | level4"
            format="1.A.(1).(a)."/>
            </xsl:when>
            <xsl:when test="self::level5">
            <xsl:number level="multiple"
            count="level1 | level2 | level3 | level4 | level5"
            format="1.A.(1).(a).1)."/>
            </xsl:when>
            <xsl:when test="self::level6">
            <xsl:number level="multiple"
            count="level1 | level2 | level3 | level4 |
            level5 | level6"
            format="1.A.(1).(a).1).a."/>
            </xsl:when>
            </xsl:choose>
            </xsl:for-each>
            </xsl:template>

            </xsl:stylesheet>


            t:\ftemp>call xslt mina.xml mina2.xsl mina2.out

            t:\ftemp>type mina2.out


            This is a step.



            Anther level





            One more level inside level2.

            This is a step.

            Anther level

            One more level inside level5.





            This is a step which refers levels:
            1.
            1.C.
            1.C.(5).
            1.C.(5).(a).
            1.C.(5).(a).1).
            1.C.(5).(a).1).a.

            Anther level5






            t:\ftemp>echo Done!
            Done!


            --
            World-wide corporate, govt. & user group XML, XSL and UBL training
            RSS feeds: publicly-available developer resources and training
            G. Ken Holman mailto:gkholman@...
            Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
            Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
            Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
            Legal business disclaimers: http://www.CraneSoftwrights.com/legal
          • mina_hurray
            Thank you very much for your help on this. It worked for me.
            Message 5 of 5 , Mar 22, 2007
            • 0 Attachment
              Thank you very much for your help on this. It worked for me.


              --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@...> wrote:
              >
              > At 2007-03-19 12:03 -0700, ms wrote:
              > >I tried the code that you gave me and it worked. I
              > >have just one more question for you. I have mentioned
              > >only three levels in this example. However, in my
              > >document I can have up to 6 levels.
              > >
              > >The formatting used is:
              > >
              > >level1 - 1
              > >level2 - A
              > >level3 - (1)
              > >level4 - (a)
              > >level5 - 1)
              > >level6 - a
              > >
              > >Now I modified the xref template format to:
              > >
              > > <xsl:template match="xref">
              > > <xsl:for-each select="key( 'steps',@ xrefid)">
              > ><xsl:number level="multiple"
              > >count="level1| level2 | level3|level4|level5|level6"
              > >format="1.A.(1).(a).1).a."/>
              > >
              > ></xsl:for-each>
              > > </xsl:template>
              > >Is this the correct way? I basically want to enforce
              > >the formatting numbers to be the same if a sixth level
              > >is referenced.
              > >So i want somehtinglike 1.C.(5).(a).1).a.
              > >
              > >If it is at a third level I want:
              > >
              > >1.C.(5).
              > >
              > >Please tell me if I what I am doing is right.
              >
              > Close but there is a nuance that I neglected last time. You cannot
              > easily get the trailing ")" after the "5" because it is considered
              > part of the prefix ")." to the "a". See the mina.xsl and mina.out
              > below for the effect. Note that the trailing "." on level 3 is the
              > "." at the end of the pattern.
              >
              > Since you have suffixes as well as prefixes in middle levels it will
              > have to be more complex than a simple use of <xsl:number>. See
              > mina2.xsl and mina2.out below for a complete solution. You will see
              > that I was able to combine levels 1 and 2 because of the simple
              > formatting, but I had to break out levels 3-6 because of the prefixes
              > and suffixes.
              >
              > I hope this helps.
              >
              > . . . . . . . . . . . . . Ken
              >
              >
              > t:\ftemp>type mina.xml
              > <test>
              > <level1 id="123">
              > <text>This is a step. </text>
              > <level2/>
              > <level2/>
              > <level2 id="234">
              > <text> Anther level </text>
              > <level3/>
              > <level3/>
              > <level3/>
              > <level3/>
              > <level3 id="345">
              > <text>One more level inside level2. </text>
              > <level4 id="456">
              > <text>This is a step. </text>
              > <level5 id="567">
              > <text> Anther level </text>
              > <level6 id="678">
              > <text>One more level inside level5. </text>
              > </level6>
              > </level5>
              > </level4>
              >
              > <level4 id="789">
              > <text>This is a step which refers levels:</text>
              > <xref xrefid="123"/>
              > <xref xrefid="234"/>
              > <xref xrefid="345"/>
              > <xref xrefid="456"/>
              > <xref xrefid="567"/>
              > <xref xrefid="678"/>
              > <level5>
              > <text> Anther level5 </text>
              > </level5>
              > </level4>
              > </level3>
              > </level2>
              > </level1>
              > </test>
              >
              >
              >
              > t:\ftemp>type mina.xsl
              > <?xml version="1.0" encoding="US-ASCII"?>
              > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              > version="1.0">
              >
              > <xsl:output method="text"/>
              >
              > <xsl:key name="steps" match="*[@id]" use="@id"/>
              >
              > <xsl:template match="xref">
              > <xsl:for-each select="key('steps',@xrefid)">
              > <xsl:number level="multiple"
              > count="level1 | level2 | level3 | level4 | level5
              | level6"
              > format="1.A.(1).(a).1).a."/>
              > </xsl:for-each>
              > </xsl:template>
              >
              > </xsl:stylesheet>
              >
              >
              > t:\ftemp>call xslt mina.xml mina.xsl mina.out
              >
              > t:\ftemp>type mina.out
              >
              >
              > This is a step.
              >
              >
              >
              > Anther level
              >
              >
              >
              >
              >
              > One more level inside level2.
              >
              > This is a step.
              >
              > Anther level
              >
              > One more level inside level5.
              >
              >
              >
              >
              >
              > This is a step which refers levels:
              > 1.
              > 1.C.
              > 1.C.(5.
              > 1.C.(5).(a.
              > 1.C.(5).(a).1.
              > 1.C.(5).(a).1).a.
              >
              > Anther level5
              >
              >
              >
              >
              >
              >
              > t:\ftemp>type mina2.xsl
              > <?xml version="1.0" encoding="US-ASCII"?>
              > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              > version="1.0">
              >
              > <xsl:output method="text"/>
              >
              > <xsl:key name="steps" match="*[@id]" use="@id"/>
              >
              > <xsl:template match="xref">
              > <xsl:for-each select="key('steps',@xrefid)">
              > <xsl:choose>
              > <xsl:when test="self::level1 or self::level2">
              > <xsl:number level="multiple"
              > count="level1 | level2"
              > format="1.A."/>
              > </xsl:when>
              > <xsl:when test="self::level3">
              > <xsl:number level="multiple"
              > count="level1 | level2 | level3"
              > format="1.A.(1)."/>
              > </xsl:when>
              > <xsl:when test="self::level4">
              > <xsl:number level="multiple"
              > count="level1 | level2 | level3 | level4"
              > format="1.A.(1).(a)."/>
              > </xsl:when>
              > <xsl:when test="self::level5">
              > <xsl:number level="multiple"
              > count="level1 | level2 | level3 | level4 | level5"
              > format="1.A.(1).(a).1)."/>
              > </xsl:when>
              > <xsl:when test="self::level6">
              > <xsl:number level="multiple"
              > count="level1 | level2 | level3 | level4 |
              > level5 | level6"
              > format="1.A.(1).(a).1).a."/>
              > </xsl:when>
              > </xsl:choose>
              > </xsl:for-each>
              > </xsl:template>
              >
              > </xsl:stylesheet>
              >
              >
              > t:\ftemp>call xslt mina.xml mina2.xsl mina2.out
              >
              > t:\ftemp>type mina2.out
              >
              >
              > This is a step.
              >
              >
              >
              > Anther level
              >
              >
              >
              >
              >
              > One more level inside level2.
              >
              > This is a step.
              >
              > Anther level
              >
              > One more level inside level5.
              >
              >
              >
              >
              >
              > This is a step which refers levels:
              > 1.
              > 1.C.
              > 1.C.(5).
              > 1.C.(5).(a).
              > 1.C.(5).(a).1).
              > 1.C.(5).(a).1).a.
              >
              > Anther level5
              >
              >
              >
              >
              >
              >
              > t:\ftemp>echo Done!
              > Done!
              >
              >
              > --
              > World-wide corporate, govt. & user group XML, XSL and UBL training
              > RSS feeds: publicly-available developer resources and training
              > G. Ken Holman mailto:gkholman@...
              > Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
              > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
              > Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/f/bc
              > Legal business disclaimers: http://www.CraneSoftwrights.com/legal
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.