I'm having some difficulty creating a null DOCTYPE with the new Xerces2
beta.  Perhaps this is a bug, or perhaps I'm simply going about it wrong.
I'm using the JAXP interfaces to get the DOMImplementation.  Then I attempt
to call 'createDocumentType(...)' as follows:

===============

        doctype = dom.createDocumentType ("", "", "");

        recordDoc = dom.createDocument ("", localName, doctype);

===============

I've also tried using the keyword 'null' in place of the empty string, but
to no avail.  Each attempt is met with a runtime exception
"org.w3c.dom.DOMException: DOM002 Illegal character."

The reason I'm trying to create a null doctype is because for the time
being, I have no desire to validate my documents, but wish to create (via
the DOMImplementation) a new document with a dynamically-determined document
element name.  I seem to recall the 'createDocument(...)' method blowing up
if it receives a null doctype element - but I haven't tried that since
Xerces 1.1 or so.

This particular code was changed from:

===============

        doctype = new DocumentTypeImpl (null, null, null, "");

===============

in order to utilize the JAXP interface and remove or dependence on Xerces
(though there is no plan to use another parser in the short term).

This second snippet worked in Xerces 1.2.3.  I'm wondering if I did
something horrendous in my 'translation' to JAXP, or if there is indeed
something wrong with Xerces2.

Thank you for you help regarding this matter.

Brion Swanson

--------------
Brion Swanson
Software Engineer
West Group - Public Records
[EMAIL PROTECTED]
(716)546-5530 ext. 3659

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to