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

RE: invalid xpath?

Subject: RE: invalid xpath?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 2 Jul 2008 14:59:50 +0100
RE:  invalid xpath?
> A simple question is getting more and more complex! I still 
> don't understand why the original stylesheet (..)[..] thru 
> Saxon drops the newlines as I want, and the modified 
> stylesheet (..) and (..) thru xsltproc/XMLSpy turns them into 
> space characters as I don't want.

It's very unlikely that the original stylesheet does what you want in XSLT
2.0, even though it is legal.

You wrote

test="not(preceding-sibling::*)[starts-with($Arg,'&#x0a;')]"


The first part

not(preceding-sibling::*)

is either true or false.

In XPath 2.0 you can filter any value or sequence with a predicate. So if

[starts-with($Arg,'&#x0a;')]

is true, then the value of the test expression is the same as the value of
[starts-with($Arg,'&#x0a;')], while if the predicate is false, the value of
the test expression is an empty sequence, which is treated as false.

I think it's rather unlikely this is what you intended. My immediate thought
was that the intended expression was

test="not(preceding-sibling::*[starts-with($Arg,'&#x0a;')])"

but since the value of the predicate doesn't depend in any way on the
context node, that seems unlikely as well. So I'm afraid I can't help you
correct your code without knowing what it was intended to do.

Michael Kay
http://www.saxonica.com/

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.