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

Re: XML overlap - processing a node-set defined by <s

Subject: Re: XML overlap - processing a node-set defined by <start/> and <end/>
From: "James Fuller" <james.fuller.2007@xxxxxxxxx>
Date: Sat, 17 Feb 2007 22:59:15 +0100
Re:  XML overlap - processing a node-set defined by  <s
yes, clix is the next step,

http://www.mulberrytech.com/Extreme/Proceedings/html/2004/Piez01/EML2004Piez01.html

is another good paper.

there are a few ways to skin this cat;

Until I found out more about the later mentioned validator build on
Saxon, my XSLT related question is this:

Is the best (performant) way to work on the selection the following?

<xsl:variable name="precedingStarts" select="count(preceding::text:start)"/>

<xsl:if test="$precedingStarts != 0">
    <xsl:variable name="followingEnds"
select="count(following::text:end)"/>
    <xsl:if test="$precedingStarts = $followingEnds">
    <!-- do something -->
    </xsl:if>
</xsl:if>

don't know, though it smells like you could just work off some alternating thing as in theory starts and ends should match (and alternate), should save xslt from calculating a few count() operations each time.

its like the alternate row colour problem for tables, e.g. (position()
- 1) mod 2

u could even eschew start and end and just use single text:mark element

irregardless of how you are keying your text: element(s) where just
remember that your 1st text:element to 2nd text:element would be your
first range, 3rd text:element to 4th text:element be your second
range, etc...

u could prob optimise using xsl:key as well.

dont know, dont have enough time to try it myself.

Is there any possibility to cache this?

there is a possibility to compile your xslt using xsltc, I think latest saxon supports this.

gl, James Fuller

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-2011 All Rights Reserved.