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

Re: General rule for designing XPath expressions to r

Subject: Re: General rule for designing XPath expressions to return items in document order?
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Thu, 9 Jan 2014 10:36:45 +0000
Re:  General rule for designing XPath expressions to  r
Hi Folks,

In yesterday's discussions we concluded that XPath expressions always return
values in document order. However, I have a counter-example (from section 19.1
of the XSLT 3.0 specification).

Consider this XML:

<Document>
    <head>
        <head>B</head>
        A
    </head>
</Document>

Clearly "A" comes after "B" in the document. But this XPath:

	//head

results in outputting the latter value ("A") first and the earlier value ("B")
second. In fact, because of this non-document-order behavior, that XPath
expression is not streamable (the processor would fetch "A" and then have to
back up to fetch "B", and backing up is not allowed in streaming).

On the other hand, this XPath expression results in outputting the values in
document order:

	//head/text()

That XPath results in outputting "B" followed by "A". Consequently that XPath
is streamable.

So, some XPath expressions output in document order, some XPath expressions do
not. Some XPath expressions are streamable, some are not. Some XPath
expressions are rewritten internally by the XPath-processor to make them
streamable, some XPath expressions are not rewritten.

I am completely bewildered.

/Roger

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.