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

Re: Problem with Position()?

Subject: Re: Problem with Position()?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sat, 13 Oct 2007 18:25:19 +0200
Re: Problem with Position()?
Jay Bryant wrote:

Try changing the test to use the preceding-sibling axis, thus:


<xsl:when test="count(preceding-sibling::p) = 0">

That test catches the first p in a series of neighboring p elements.



Be aware that with large input files and with a not-too-optimizing processor, this test might perform quadratic. If that happens, you can try changing it to:

<xsl:when test="not(preceding-sibling::p[1])">

which will behave the same but is easier optimized by the processor.

A note to the OP: in your xsl:otherwise statement you have na added xsl:if which seems redundant there because it tests for the inverse of the xsl:when. If so intended, you can remove it.

Cheers,
-- Abel Braaksma

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.