S
Stefan Ram
I have found a nice example of how to create an XML document
using DOM with Java:
http://www.cafeconleche.org/books/xmljava/chapters/ch10s03.html
Now, my problem is: When I modify the element type name "desc"
to "slrdesc", the document is still built with the new element
type name "slrdesc". I assume, that the SVG-DTD does not allow
such an element type name "slrdesc" and that therefore the
document created is invalid.
I'd like to have a validating document builder, i.e., in the
very moment, when I am attempting to insert a node that would
make the tree invalid, I want the builder to refuse this
attempt and to report an error, possibly throw an exception or
so. The document of the example above knows its DTD, but it
does not seem to do this validation. Is there a library for
Java to build a DOM (or something like this) with validation
at the momemt an attempt to modify the document is made?
(I would like to use this to create XHTML 1.x documents.)
Or is there at least an explicit call to validate the DOM,
which I have missed?
using DOM with Java:
http://www.cafeconleche.org/books/xmljava/chapters/ch10s03.html
Now, my problem is: When I modify the element type name "desc"
to "slrdesc", the document is still built with the new element
type name "slrdesc". I assume, that the SVG-DTD does not allow
such an element type name "slrdesc" and that therefore the
document created is invalid.
I'd like to have a validating document builder, i.e., in the
very moment, when I am attempting to insert a node that would
make the tree invalid, I want the builder to refuse this
attempt and to report an error, possibly throw an exception or
so. The document of the example above knows its DTD, but it
does not seem to do this validation. Is there a library for
Java to build a DOM (or something like this) with validation
at the momemt an attempt to modify the document is made?
(I would like to use this to create XHTML 1.x documents.)
Or is there at least an explicit call to validate the DOM,
which I have missed?