-
Notifications
You must be signed in to change notification settings - Fork 118
JDOM2 Feature Text Coalesce
In JDOM you could potentially end up with multiple consecutive Text items in your Element content. This will seldom happen because typically this can only be done programmatically. JDOM will always coalesce the character data coming from parsers, so, in essence you would have to manually add consecutive Text content, or remove some other content that previously separated Text content, etc. in order to get in to this condition.
There is nothing technically wrong with consecutive Text content, but it can sometimes be challenging to process. The DOM XML Model has the Node.normalize()
method to identify and remove these conditions. JDOM 2.0.0 introduces the Element.coalesceText(boolean)
method which does essentially the same thing. It joins adjacent Text content and removes any empty-String content. The coalesceText(boolean)
method will perform the operation on itself and all child elements recursively if given a true
parameter, and only itself if given a false
.
[JDOM Home](http://www.jdom.org)
Stable Release
- [Download](http://www.jdom.org/downloads/index.html)
- [JavaDoc](http://www.jdom.org/docs/apidocs/index.html)
JDOM 2.x
- Overview
- Getting Started
- JDOM on Android
- [JavaDoc](http://hunterhacker.github.com/jdom/jdom2/apidocs/index.html)
- [Coverage](http://hunterhacker.github.com/jdom/jdom2/coverage/index.html)
- [UnitTests](http://hunterhacker.github.com/jdom/jdom2/junit.report/index.html)
- Features
- JDOM 1.x to JDOM 2.x
- Dependencies
Developing JDOM