Skip to content
New issue

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

NodeSeq attribute search does not work as expected #9047

Closed
scabug opened this issue Dec 17, 2014 · 4 comments
Closed

NodeSeq attribute search does not work as expected #9047

scabug opened this issue Dec 17, 2014 · 4 comments

Comments

@scabug
Copy link

scabug commented Dec 17, 2014

When using the back-slash operator on a NodeSeq, the behaviour does not match how XPath works. Getting the attribute value works when there's only a single element in the node sequence:

> val x = <x><a b='1'/></x>
> x \ "a" \ "@b"
res2: scala.xml.NodeSeq = 1

but fails when there are more:

> val x = <x><a b='1'/><a b='2'/></x>
> x \ "a" \ "@b"
res3: scala.xml.NodeSeq = NodeSeq()

expected:

res3: Seq(1, 2)
@scabug
Copy link
Author

scabug commented Dec 17, 2014

Imported From: https://issues.scala-lang.org/browse/SI-9047?orig=1
Reporter: Sunny Kalsi (skalsi)
Affected Versions: 2.10.4

@scabug
Copy link
Author

scabug commented Dec 17, 2014

Joseph Walton (jwalton) said:
I've taken a look at this and opened a PR with tests and a possible fix: SI-9047: Extract attributes from multiple elements.

@scabug
Copy link
Author

scabug commented Jul 17, 2015

@SethTisue said:
The scala-xml library is now community-maintained. Issues with it are now tracked at https://github.com/scala/scala-xml/issues instead of here in the Scala JIRA.

Interested community members: if you consider this issue significant, feel free to open a new issue for it on GitHub, with links in both directions.

@scabug scabug closed this as completed Jul 17, 2015
@scabug
Copy link
Author

scabug commented Jul 20, 2015

@SethTisue said:
scala/scala-xml#63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant