We all know that standard Java DOM implementation by Sun, which is bundled with JDK since early eras, has certain disadvantages:
org.w3c.dom.NodeList
does not provide a common Java collections interface iterate through it.org.w3c.dom.Document#getElementById()
and org.w3c.dom.Document#getElementsByTagName()
.These limitations do not come out from bad model design but are the result of strict following W3C specifications. The way out is to use alternative libraries, which compensate these limitations plus provide some extra bonuses.
Personal notes:
String
, File
, OutputStream
or Writer
at the moment.XMLEventReader
), but not for push parsers (e.g. ContentHandler
).Attribute
implementation with mine, which extends the standard)Document
, Attribute
, Element
is a Node
) Relative links:
Node#cloneNode()
ElementHandler
should detach the node from the tree after processingNodeFactory
implementation should return empty node listOMNavigator
nu.xom.XOMHandler
, but it is non-public class"Девица не хочет лезть в Окно" – device not compatible with Windows.