[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: again position()?

Subject: RE: again position()?
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 20 Jun 2001 13:19:40 +0100
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.