"Swanson, Brion" wrote:
> 
> 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.

I'm not positive, but I don't think DOM allows you to create a Document
object without have a specific DocumentType in mind first.  There is a
way in JAXP, though, using the DocumentBuilderFactory.newDocument()
method.  Someone can correct me if I am wrong.

-Edwin

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

Reply via email to