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
in scala console
following code works correctly:
scala> val e = <ns:elems xmlns:ns="http://">{List(1, 2, 3).map(x => <ns:elem>{x}</ns:elem>) ++ List(4, 5, 6).map(x => <ns:elem>{x}</ns:elem>)}</ns:elems> e: scala.xml.Elem = <ns:elems xmlns:ns="http://"><ns:elem>1</ns:elem><ns:elem>2</ns:elem><ns:elem>3</ns:elem><ns:elem>4</ns:elem><ns:elem>5</ns:elem><ns:elem>6</ns:elem></ns:elems> scala> e \\ "elem" res0: scala.xml.NodeSeq = NodeSeq(<ns:elem xmlns:ns="http://">1</ns:elem>, <ns:elem xmlns:ns="http://">2</ns:elem>, <ns:elem xmlns:ns="http://">3</ns:elem>, <ns:elem xmlns:ns="http://">4</ns:elem>, <ns:elem xmlns:ns="http://">5</ns:elem>, <ns:elem xmlns:ns="http://">6</ns:elem>)
namespace is correct in each child node.
while if using method call, namespace gets lost:
scala> def f(l: List[Int]) = l.map(x => <ns:elem>{x}</ns:elem>) f: (l: List[Int])List[scala.xml.Elem] scala> val e = <ns:elems xmlns:ns="http://">{f(List(1, 2, 3)) ++ f(List(4, 5, 6))}</ns:elems> e: scala.xml.Elem = <ns:elems xmlns:ns="http://"><ns:elem>1</ns:elem><ns:elem>2</ns:elem><ns:elem>3</ns:elem><ns:elem>4</ns:elem><ns:elem>5</ns:elem><ns:elem>6</ns:elem></ns:elems> scala> e \\ "elem" res2: scala.xml.NodeSeq = NodeSeq(<ns:elem>1</ns:elem>, <ns:elem>2</ns:elem>, <ns:elem>3</ns:elem>, <ns:elem>4</ns:elem>, <ns:elem>5</ns:elem>, <ns:elem>6</ns:elem>)
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-4865?orig=1 Reporter: Hongxin Liang (honnix) Affected Versions: 2.9.0
Sorry, something went wrong.
@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.
No branches or pull requests
in scala console
following code works correctly:
namespace is correct in each child node.
while if using method call, namespace gets lost:
The text was updated successfully, but these errors were encountered: