cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anna Afonchenko" <>
Subject Re: XPath problems in Cocoon?
Date Tue, 25 Feb 2003 09:13:16 GMT
Thanks for answering
I agree that my expression is not the cleanest, but it doesn't work in
cocoon anyway :-(
I can't understand, why it is so hard to express some not-so-difficult
I am trying to select all a nodes that are followed by another a node
without anything in between, except white spaces. I understand that my
problem is white spaces that are not ignored in any parser except for MSXML.
for <a />  <a/> or <a/><a/> I want my expression to pick the first
for <a/>text<a/> or <a/><br/><a/> I do not want my expression
to pick the a.

I don't want to ignore any text nodes, just the whitespace-only ones.
Expression //a[following-sibling::*[1][self::a]] will select also a nodes
woth some simple text in between, and I do not want it.
I don't believe that this should be that complicated, but the fact is that I
cannot manage to construct the expression that will choose exactly what I
need, no more, no less.

Sorry to drag this thread for so long, but maybe you can help me a little
bit more with this and help me to find the right expression that will work
in Cocoon?

Thank you very very much for help.
I appreciate it very much.

----- Original Message -----
From: "J.Pietschmann" <>
To: <>
Sent: Monday, February 24, 2003 9:21 PM
Subject: Re: XPath problems in Cocoon?

Anna Afonchenko wrote:
> But when I tried to apply this stylesheet using cocoon, I still got the
> empty root element <root/  as a result.

That's because strip-space doesn't apply if the input is delivered
through a SAX pipeline (although the spec is a bit ambiguous about

Actually, your expression is ugly. What's wrong with
This means "select a elements where the following element
(disregarding any text node) is also an a element."
This is not quite equivalent to your expression but will give
the same result for your XML source, and it will work regardless
whether whitespace nodes are stripped.
There's half a zillion other possibilities to express the same
or similar conditions. If you give a description of the effect
you want to achieve, a proper expression can be formulated.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message