[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Yes, you are so right (how do you know what I meant if I didn't know!?!? :)
But here is also the problem:
Let say we have another XML:
<root>
<some_tag/>
<line>
<a/>
<b/>
</line>
<line>
<a/>
<b/> - we are here
</line>
<root>
In your example select="count(../preceding-sibing::* + 1)" we get 3 because it will count "some_tag" too. But we need to count only "line" elements.
How we can solve this problem?
Jenya
David Carlisle writes:
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
[xsl] Re: Is it possible to know position of ancestor?
Subject: [xsl] Re: Is it possible to know position of ancestor? From: evgeniy.strokin@xxxxxxxxxxxxxxxx Date: Thu, 17 Oct 2002 19:10:53 GMT |
Yes, you are so right (how do you know what I meant if I didn't know!?!? :)
But here is also the problem:
Let say we have another XML:
<root>
<some_tag/>
<line>
<a/>
<b/>
</line>
<line>
<a/>
<b/> - we are here
</line>
<root>
In your example select="count(../preceding-sibing::* + 1)" we get 3 because it will count "some_tag" too. But we need to count only "line" elements.
How we can solve this problem?
Jenya
David Carlisle writes:
We are in tag "b",note that xslt works on elements (element nodes) not tags, and importat
distinction.
We want to find out what is position of our ancestor in their ancestor.
I think you mean parent rather than ancestor:
select="count(../preceding-sibing::* + 1)"
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Is it possible to know po, David Carlisle | Thread | RE: [xsl] Re: Is it possible to kno, James Carlyle |
RE: [xsl] Arguments for XSL, KIENLE, STEVEN C [IT | Date | RE: [xsl] Arguments for XSL, Lee V |
Month |
Keywords