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

Re: calculating relative position in document order

Subject: Re: calculating relative position in document order
From: "Darcy Parker" <darcyparker@xxxxxxxxx>
Date: Thu, 16 Oct 2008 14:15:06 -0400
Re:  calculating relative position in document order
Hi Tom,

(Earlier today Michael Kay answered a message that involved
recommending this library:  http://www.functx.com/functx/ ... so I had
a quick look at functx and it is fresh in my mind.)

These functions are not exactly like your fantasy pseudo code... but I
think there some useful functions that may have help solve your
problem....

For example:
http://www.xsltfunctions.com/xsl/functx_sequence-node-equal.html
http://www.xsltfunctions.com/xsl/functx_sequence-node-equal-any-order.html

If you peruse the functions, I think you'll find many other
interesting/related functions that you may be able to leverage.

(Note: I found the download link difficult to find on the page...
Hint: It's at the top of the page.)

Darcy
On Thu, Oct 16, 2008 at 12:53 PM, tom s <tshmit@xxxxxxxxx> wrote:
> Hi,
>
> I'd like to be able to determine which element is "closer", in terms of document order, to a given element. eg, given two structures containing siblings:
>
>        <a>
>        <b>
>        <c>
> and
>        <b>
>        <a>
>        <c>
>
> I'd like to detect that the second structure is "out of order". In my fantasy pseudo code, I might express the constraint as:
>
> //c[positionEX(preceding::a[1]) > positionEX(preceding::b[1])]
>
> Where my fantasy positionEX() function returns the absolute position of the argument in the document.
>
> Am I missing something, or is implementing this operation in real xpath/xslt much more difficult than it seems it should be?
>
> Thanks in advance for any help...
>
> --T

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.