You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by Bjorn Hermans <bj...@e-cube.nl> on 2002/03/25 12:45:23 UTC
How can I assign an external DTD to a newly created document?
Hi,
I'm using Xerces to create a new XML document, but I cannot find out how
to assign an external DTD to this new document. From what I can gather
from the documentation of Xerces-C, the first parameter of the
createDocument function looks like the place to put this assignment, but
the URL to the external URL does not show up when I do a
"XML::Xerces::DOMParse::print ..." statement, e.g. I get an output like:
<!DOCTYPE paymentService PUBLIC '-//Bibit/DTD Bibit PaymentService
v1//EN' >
(I would expect the URL to the external DTD to show up right after the
identifier...)
Please help!
Regards,
Bjorn Hermans.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org
Re: How can I assign an external DTD to a newly created document?
Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Bjorn Hermans" <bj...@e-cube.nl> writes:
> Hi,
>
> I'm using Xerces to create a new XML document, but I cannot find out how
> to assign an external DTD to this new document. From what I can gather
> from the documentation of Xerces-C, the first parameter of the
> createDocument function looks like the place to put this assignment, but
> the URL to the external URL does not show up when I do a
> "XML::Xerces::DOMParse::print ..." statement, e.g. I get an output like:
> <!DOCTYPE paymentService PUBLIC '-//Bibit/DTD Bibit PaymentService
> v1//EN' >
> (I would expect the URL to the external DTD to show up right after the
> identifier...)
Hey Bjorn,
Here's some code pirated from t/domTest.t:
DB<3> $impl = XML::Xerces::DOM_DOMImplementation::getImplementation();
DB<4> $dt = eval{$impl->createDocumentType('personnel', '', 'personal.dtd')};
DB<5> p $dt->serialize
<!DOCTYPE personnel SYSTEM "personal.dtd">
DB<6> $doc = eval{$impl->createDocument('personnel', 'personnel',$dt)};
DB<7> p $doc->serialize
<!DOCTYPE personnel SYSTEM "personal.dtd">
<personnel/>
This is the sum total that I know about the issue.
Hope this helps,
jas.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org