Xerces Perl - Don't want DOCTYPE

B

Bob

I use Xerces/Perl to create an XML document that will use Schemas
instead of DTDs for validation. When I attempt to create a document
with a docType of null, I get an error.

This works:
$docType = eval{$impl->createDocumentType("none", '', '')};
$doc = eval{$impl->createDocument($nameSpace, 'dfStudy', $docType)};

But then I'm stuck with a line in my XML file "<!DOCTYPE none>"
(which, of course, is garbage)

This does not work:
$doc = eval{$impl->createDocument($nameSpace, 'dfStudy', '')};

The error message is:
No matching function for overloaded 'DOMImplementation_createDocument'
at...

Of course, the easy way to get rid of the DOCTYPE line would be to sed
the output of the DOMWriter, but I'd rather make it clean by not
having it there in the first place. Any ideas?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top