We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stackoverflow question raises a fair concern that the documentation for \ is ambiguous.
\
https://stackoverflow.com/questions/47593308/xml-xpath-search-excludes-parent-node-but-recursive-search-doesnt
Currently, the doc for \ reads:
Projection function, which returns elements of this sequence based on the string that. Use: this \ "foo" to get a list of all elements that are labelled with "foo"; \ "_" to get a list of all elements (wildcard); ns \ "@foo" to get the unprefixed attribute "foo"; ns \ "@{uri}foo" to get the prefixed attribute "pre:foo" whose prefix "pre" is resolved to the namespace "uri".
Projection function, which returns elements of this sequence based on the string that. Use:
this
that
this \ "foo"
"foo"
\ "_"
ns \ "@foo"
ns \ "@{uri}foo"
"pre:foo"
"pre"
"uri"
The original poster, raised the following examples:
scala> <b>foo</b> \ "b" res0: scala.xml.NodeSeq = NodeSeq() scala> <b>foo</b> \\ "b" res1: scala.xml.NodeSeq = NodeSeq(b)
The confusion is that element searches with \ only operate on the current element's children, while \\ operates on the self, as well.
\\
Additionally, it's worth pointing out that putting @ in the search will find attributes on the current element, and not its children.
@
scala> <b a="c">foo</b> \ "@a" res2: scala.xml.NodeSeq = c
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Stackoverflow question raises a fair concern that the documentation for
\
is ambiguous.https://stackoverflow.com/questions/47593308/xml-xpath-search-excludes-parent-node-but-recursive-search-doesnt
Currently, the doc for
\
reads:The original poster, raised the following examples:
The confusion is that element searches with
\
only operate on the current element's children, while\\
operates on the self, as well.Additionally, it's worth pointing out that putting
@
in the search will find attributes on the current element, and not its children.The text was updated successfully, but these errors were encountered: