Discussion:
[XOM-interest] XOM vs JDOM: XML validation
Dmitry Katsubo
2010-09-17 11:13:35 UTC
Permalink
Dear XOM developers!

Recently I found a nice talk of Elliotte Rusty Harold in [1], where it
is said that in JDOM it is possible to create a non-valid XML. And I
have a few questions here:

(a) It is mentioned, that JDOM does not make a validation of text nodes.
I have checked the latest JDOM v1.0 sources and this very validation is
in place (maybe it is buggy, but that is different story). I also
checked that node name validation is in place. So can anybody here write
a short piece of Java code for JDOM v1.0, that results an invalid XML?

(b) I wonder, if this invalid XML is converted to Java W3C DOM and then
passed to Xerces serializer, will it trigger Exception? I will certainly
try when I get (a).

[1] http://www.artima.com/intv/jdom2.html
--
With best regards,
Dmitry
Christophe Marchand
2010-09-17 12:08:22 UTC
Permalink
It could be quite easy to write a serializer that do not write valid
XML... ;-)) I should have such an example in my first XML codes...

Christophe
Post by Dmitry Katsubo
Dear XOM developers!
Recently I found a nice talk of Elliotte Rusty Harold in [1], where it
is said that in JDOM it is possible to create a non-valid XML. And I
(a) It is mentioned, that JDOM does not make a validation of text nodes.
I have checked the latest JDOM v1.0 sources and this very validation is
in place (maybe it is buggy, but that is different story). I also
checked that node name validation is in place. So can anybody here write
a short piece of Java code for JDOM v1.0, that results an invalid XML?
(b) I wonder, if this invalid XML is converted to Java W3C DOM and then
passed to Xerces serializer, will it trigger Exception? I will certainly
try when I get (a).
[1] http://www.artima.com/intv/jdom2.html
Dmitry Katsubo
2010-09-22 12:28:30 UTC
Permalink
Post by Christophe Marchand
It could be quite easy to write a serializer that do not write valid
XML... ;-)) I should have such an example in my first XML codes...
Christophe
Christophe,

Thank you a lot for comments! Could you please attach Java sample to
message or give URL to such example or point me to the book / resource
/ whatever you are referring to.

Thanks in advance.

Loading...