[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|