AW: evaluating the following-sibling axis

"Kirmse, Daniel" <[email protected]> Mon, 22 Mar 2004 16:53:46 +0100
Newsgroups gmane.text.xml.xpath.general
Message-ID <[email protected]>
Hi Michael,

thanks fort he hint to the lists. I will post my questions there.

With that coreection I do understand the expression. But may it be that =
there is another typo in it? What about the "<<" operator? Shouldn't it =
be ">>" instead for following-sibling?

Considering the example again:

<a>
  <b/>
  <c/>
  <d/>
</a>

and the expression:

/a/b/following-sibling::*

after your correction we have:

let $e =3D .
return parent::node()/child::*[. << $e]

or in the context of the example:

let $e =3D "b"
return parent::node()/child::*[. << "b"]

with parent::node()/child::* =3D (b,c,d) and the result being a =
sequence

(parent::node()/child::*["b" << "b"], parent::node()/child::*["c" << =
"b"], parent::node()/child::*["d" << "b"])

that would be empty.

If "<<" would be replaced by ">>" we would get:

(parent::node()/child::*["b" >> "b"], parent::node()/child::*["c" >> =
"b"], parent::node()/child::*["d" >> "b"])

what would yield (c,d)

If you confirm this, I would post the typo report to the list you =
provided ([email protected])

BTW: The same applies for preceding-sibling definition


Cheers,
Daniel Kirmse




-----Urspr=FCngliche Nachricht-----
Von: Michael Kay [mailto:[email protected]]=20
Gesendet: Montag, 22. M=E4rz 2004 14:34
An: Kirmse, Daniel; [email protected]
Betreff: RE: evaluating the following-sibling axis

#=20
# Maybe it's not the right place for this question, but no one=20
# in comp.text.xml could/would provide an answer.

A good place for such questions is the xsl-list at mulberrytech.com

However, I think you've actually found a typo in the formal semantics =
which
should be reported to [email protected]
 =20
... to compute the result I'd use the XQuery=20
# 1.0 and XPath 2.0 Formal Semantics paper section 4.2.1.1.=20
# There an expression for evaluating the following-sibling axis=20
# is given:
#=20
# [following-sibling:: NodeTest]Axis
# =3D=3D
# [let $e :=3D . in parent::node()/child:: NodeTest [.<<$e]]Expr=20
#=20
# and that is the problem.

I think this should read:

let $e :=3D .=20
return parent::node()/child:: NodeTest [.<<$e]]

This is simply saying that the following siblings of a node are the =
children
of the parent of that node that follow that node in document order.

Michael Kay