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

Represent empty XML elements in short form #1118

Closed
scabug opened this issue Jul 18, 2008 · 14 comments
Closed

Represent empty XML elements in short form #1118

scabug opened this issue Jul 18, 2008 · 14 comments
Milestone

Comments

@scabug
Copy link

scabug commented Jul 18, 2008

current:

scala> <abc/>
res0: scala.xml.Elem = <abc></abc>

after patch:

scala> <abc/>
res0: scala.xml.Elem = <abc/>
@scabug
Copy link
Author

scabug commented Jul 18, 2008

Imported From: https://issues.scala-lang.org/browse/SI-1118?orig=1
Reporter: brian (brian0)
Assignee: @acruise
Attachments:

@scabug
Copy link
Author

scabug commented Sep 3, 2008

Geoffrey Alan Washburn (washburn) said:
Philipp I think you're handling reviews of changes to library code, so I've reassigned this to you.

@scabug
Copy link
Author

scabug commented May 1, 2009

@paulp said:
As long as scala isn't tracking how the element was originally represented (and it isn't - whether it should, I do not know) this looks like an easy win. Patch applied in r17612.

@scabug
Copy link
Author

scabug commented May 15, 2009

@paulp said:
Reopening because it caused the problems described here:

http://www.nabble.com/The-scaladoc-files-generated-by-Scala-2.8.0-are-not-visible-on--Firefox.-td23555632.html

Assigning to myself, opened so I don't forget.

@scabug
Copy link
Author

scabug commented Mar 19, 2010

@acruise said:
A new patch against trunk @ 21213, hopefully better handling of empty tags

@scabug
Copy link
Author

scabug commented Mar 19, 2010

@acruise said:
With this patch (submitted here for review, not committed yet!), the originally parsed emptiness modes of elements are now preserved on output:

Welcome to Scala version 2.8.0.r21213-b20100318230317 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_17).
Type in expressions to have them evaluated.
Type :help for more information.

scala> <hi>there <man/><how></how>'s it going?</hi>
res0: scala.xml.Elem = <hi>there <man/><how></how>'s it going?</hi>

Please note that this version of the patch does not (yet) make any changes to tests, so some of them will probably fail until I update it tomorrow.

If people are happy with this approach, I'll update the tests (and write a few more) and throw it out for wider comment.

@scabug
Copy link
Author

scabug commented Mar 28, 2010

@acruise said:
Oops, previous one was old; this is new

@scabug
Copy link
Author

scabug commented Aug 9, 2010

@acruise said:
Can I get some feedback on my patch? It addresses this issue, adds another test, and is basically ready to commit.

@scabug
Copy link
Author

scabug commented Nov 9, 2011

@paulbutcher said:
I just fell into this hole. After much searching of the documentation, I finally stumbled across:

xml.Utility.toXML(x, minimizeTags = true)

I wonder why this is a method in Utility, and not on Node (hich would be much more convenient and discoverable)?

@scabug
Copy link
Author

scabug commented Mar 9, 2012

@acruise said:
I brought my patch up to date with master, https://github.com/acruise/scala/tree/t1118. It compiles, tests pass (for me at least!) and it works:

acruise@acruise-PC ~/dev
$ scala
Welcome to Scala version -unknown- (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31).
Type in expressions to have them evaluated.
Type :help for more information.

scala> <hithere/>
res0: scala.xml.Elem = <hithere/>

@scabug
Copy link
Author

scabug commented Mar 12, 2012

@paulp said:
If you add some testing for the functionality being added and send me a pull request, I'll incorporate it.

@scabug
Copy link
Author

scabug commented Mar 12, 2012

@acruise said:
Cool! There is a test, but it was in the wrong directory. I've moved it and made it a little less cutesy, just merging and retesting now.

@scabug
Copy link
Author

scabug commented Mar 19, 2012

@acruise said:
My fix was merged to master a few days ago, it should ship in 2.10.

@scabug scabug closed this as completed Mar 19, 2012
@scabug
Copy link
Author

scabug commented Jul 9, 2015

@SethTisue said:
For the same issue but with PrettyPrinter, see scala/scala-xml#46

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