Subject: RE: Node position and numbering.
From: c p <bugs75il@xxxxxxxxx>
Date: Thu, 5 May 2005 11:48:25 -0700 (PDT)
|
I gotta tell ya! Man is Brilliant! Worked like a
charm.
I looked into that but I am guessing the documentation
from MSDN site did an alright job of explanation of
<xsl:number/>
Anyhow thank you so much.
C
--- Michael Kay <mike@xxxxxxxxxxxx> wrote:
> <xsl:number/> with no attributes will give you what
> you want.
>
> Michael Kay
> http://www.saxonica.com/
>
>
>
> > -----Original Message-----
> > From: c p [mailto:bugs75il@xxxxxxxxx]
> > Sent: 05 May 2005 18:07
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: Node position and numbering.
> >
> > Hello all,
> >
> > I have following XML:
> > -----------------------------------------
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <service>
> > <title>Printing the Page</title>
> > <somenode>node content might go
> here.</somenode>
> > <step>Go to File menu</step>
> > <step>Select Print</step>
> > <step>Click Print</step>
> > <somenode>you are all done.</somenode>
> > </service>
> >
> > -----------------------------------------
> > As you can see the XML has a <service> node with a
> > whole bunch of other child nodes. Out of all the
> > child nodes, I am interested in getting the
> position
> > for <step> nodes only. Its pretty simple but
> there's
> > a twist. In the example above if I did
> > <xsl:apply-templates match="service"/> and then
> for
> > each child node I did a position() then it would
> give
> > me numbers 2,4,and 5 for the <step> nodes.
> However
> > thats not what I want. I want it to give me
> numbers
> > 1,2,3 for the <step> nodes. The way I can get
> that is
> > by doing <xsl:apply-templates
> match="service/step"/>,
> > unfortunately due to the complexity of my XSL and
> XML
> > structure I cannot do that. Is there a way to
> achieve
> > this so I can get an output that will look like
> this:
> >
> > ---------------------------------------------
> > 1. Go to File menu
> > 2. Select Print
> > 3. Click Print
> > ---------------------------------------------
> >
> > Note: Its not always guaranteed that the first
> <step>
> > node will start after <title> node or any other
> node.
> > It could be random.
> >
> > Any help would be appreciated.
> >
> > Thx,
> > C
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|