xsl-list
[Top] [All Lists]

RE: [xsl] invalid xpath?

2008-07-02 07:00:27
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,'
')]"


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,'
')]

is true, then the value of the test expression is the same as the value of
[starts-with($Arg,'
')], 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,'
')])"

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/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>