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

<br/> to <p> and optimization

Subject: <br/> to <p> and optimization
From: Emmanuel Bégué <emmanuel@xxxxxxxxxxxxx>
Date: Wed, 2 Jul 2003 13:02:58 +0200
emmanuel begue
Hello,

On the archives of this list I have found a solution to the problem
of putting all elements between two <br/> elements into a <p> element:
http://www.biglist.com/lists/xsl-list/archives/200101/msg00865.html

However, this process takes a very very long time for "big" files
(over 100k) which have lots of brs (up to two minutes), and I am looking
for a way to optimize it.

In fact my problem is I'm not sure I correctly understand the following
line:
	<xsl:variable name="content"
		select="preceding-sibling::node()
			[not($br-before) or
 			generate-id(preceding-sibling::br[1]) =
			generate-id($br-before)]" />

	$br-before is the preceding <br/>:
		<xsl:variable name="br-before"
			select="preceding-sibling::br[1]" />

So, for setting $content, do we mean that we test _all_ nodes before
the current <br/>, and for each of them we test that they are not
themselves the preceding <br/> (not($br-before)) and that they are
actually after the same <br/> than the one located by $br-before?

In that case obviously we test the same nodes many times: for every
new <br/>, we want to add nodes that are before the current <br/> and
after the preceding one, but we test again the nodes that are before
the last <br/> up to the start of the containing element. Therefore
what we need is a way to "stop" the selection once the current node
that is being tested is in fact $br-before?

Is this correct?

Regards,
Emmanuel Bégué



 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.