Comments (12)
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.
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.
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.
Sure seems like a bug to me.
from scala-xml.
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.
Checking why the build is failing.
from scala-xml.
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.
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.
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.
@ashawley #90 was merged, should this be closed?
from scala-xml.
haha jinx
from scala-xml.
Thank you!
from scala-xml.
Related Issues (20)
- Publish 2.0.0 HOT 1
- Update CHANGELOG.md HOT 2
- Shut down Gitter room, enable GitHub Discussions? HOT 4
- CDATA in MarkupParser HOT 3
- ConstructingParser does not tolerate start of file whitespace HOT 1
- ConstructingParser throws NoSuchMethodError in Scala 3 HOT 6
- Release 2.0.1
- versionPolicyCheck fails for scalajs-library HOT 4
- ""
- Publish next release (to publish Scala 3 Native support) HOT 15
- Version 2.10 null pointer on toString
- Name predicates: which XML version? HOT 2
- Re-enable versionPolicyCheck HOT 2
- Update CHANGELOG, README? HOT 1
- Drop support for Scala 2.11? HOT 5
- Unused value warnings for XML literals starting with Scala 2.13.9 HOT 1
- Infinite loop caused by mismatched quotes HOT 3
- Roll a 2.2 release HOT 5
- Release 1.3.1 HOT 10
- FactoryAdapter loadDocument() modifies XMLReader and breaks it HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-xml.