Git Product home page Git Product logo

Comments (12)

ashawley avatar ashawley commented on August 16, 2024 1

Merging #90, then the PrettyPrinter will have a minimizeEmpty argument, that is set to false. I suppose that fixes this issue? After this fix is released, we can update the StackOverflow post. :)

from scala-xml.

ashawley avatar ashawley commented on August 16, 2024

Interesting about the unused leafTag function. The handling of empty elements is not exclusively a pretty-printer thing. The library generally preserves whether a closed tag or a self-closed tag was used:

scala> <node></node>.minimizeEmpty
res0: Boolean = false

scala> <node/>.minimizeEmpty
res1: Boolean = true

It seems that the Pretty-printer has inherited this behavior from the standard writer for at least the last 10 years.

I guess this raises, "What is the definition of 'pretty-printing' with respect to empty elements?" Are they preserved or not? I suppose this should be configurable in a pretty-printer at the very least.

from scala-xml.

biswanaths avatar biswanaths commented on August 16, 2024

Previous discussion on this http://comments.gmane.org/gmane.comp.lang.scala.xml/44 . Also what do other prettyprint ( different tool, language) do ? I.e. do they print or ?

from scala-xml.

SethTisue avatar SethTisue commented on August 16, 2024

Sure seems like a bug to me.

from scala-xml.

ashawley avatar ashawley commented on August 16, 2024

I made a commit in #90 that adds a Boolean parameter to PrettyPrinter that configures whether to minimize empty tags or not.

from scala-xml.

biswanaths avatar biswanaths commented on August 16, 2024

Checking why the build is failing.

from scala-xml.

ashawley avatar ashawley commented on August 16, 2024

Thanks @biswanaths! Turns out typesafehub/migration-manager checks for binary compatibility issues. I don't have access to openjdk6, but I can try to use an Oracle 6 JDK and see if I can avoid the error.

> mimaReportBinaryIssues
[warn] Credentials file /Users/aaronhawley/.ivy2/.credentials does not exist
[info] Resolving org.scala-lang#scala-library;2.11.7 ...
[info] scala-xml: found 1 potential binary incompatibilities
[error]  * method this(Int,Int)Unit in class scala.xml.PrettyPrinter does not have a correspondent in new version
[error]    filter with: ProblemFilters.exclude[MissingMethodProblem]("scala.xml.PrettyPrinter.this")
[trace] Stack trace suppressed: run last *:mimaReportBinaryIssues for the full output.
[error] (*:mimaReportBinaryIssues) scala-xml: Binary compatibility check failed!
[error] Total time: 2 s, completed Feb 10, 2016 10:59:35 AM

from scala-xml.

ashawley avatar ashawley commented on August 16, 2024

The optional argument of minimizeEmpty for the class's constructor that I introduced has been unrolled instead to an alternate constructor method. Doing this seemed to quell the migration-manager error seen with the openjdk6 build in Travis.

from scala-xml.

ashawley avatar ashawley commented on August 16, 2024

This fix was released in 1.1.0 today, and I've updated the information on the stackoverflow post. Thanks for reporting this issue.

from scala-xml.

SethTisue avatar SethTisue commented on August 16, 2024

@ashawley #90 was merged, should this be closed?

from scala-xml.

SethTisue avatar SethTisue commented on August 16, 2024

haha jinx

from scala-xml.

carlpoole avatar carlpoole commented on August 16, 2024

Thank you!

from scala-xml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.