This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: again position()?


> at first: thanks for all earlier answers -- i'll try to use them
> later.. i'm doing my xsl pages after hours, so i don't have much
> time for it the more it's not so intuitive language :-)

I'm afraid that using your own not-so-intuitive language instead isn't going
to help you communicate....
>
> i'd like to ask for a solution for such test:
>    if ((current("part") == 1) && (current("chapter") == 1))
>       intro="true";
> in xslt.
>
> by current() i mean a function which returns current
> position of a tag in xpath tree.

I suspect that you want your current("part") function (not to be confused
with the XSLT current() function) to return something like
count(ancestor::part/preceding-sibling::* + 1).

But if you're only testing the result against 1, then you're testing to see
if the element has any preceding siblings, which you can write as:

<xsl:if test="not(ancestor::part/preceding-sibling::* or
ancestor::chapter/preceding-sibling::*)">

Mike Kay
Software AG


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]