You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by John Thorhauer <jt...@phoenixcolor.com> on 2000/08/28 16:53:05 UTC

dynamically adding a DTD

Does anyone no if it is possible to programmatically attatch a DTD to an
xml document at runtime if the document has no DTD reference in the
doctype declaration?

I figured out how to change the dtd if it is already specified in the
orginal xml doc but I want to be able to specify a dtd for an xml
document that has no dtd.

I have tried setting the doctype to <!DOCTYPE envelope SYSTEM "">  but I
get a file not found error before my resolveEntity() method is called. 
So I tried setting dock type to <!DOCTYPE envelope > and then set xml
validation to true but then resolveEntity() is never called and I can
not specify a dtd.

Any ideas on how to do this?

Thanks,
John
-- 
********************************
** John Thorhauer
** jthorhauer@phoenixcolor.com
********************************

RE: dynamically adding a DTD

Posted by Christophe Brethes <ch...@free.fr>.
I worked for a lot of time on this question. ( I work on an xml document
with latin entity like &eacute; and without declaration of DTD ).The only
answer I found is :
You can not do that with xerces without modifiying xerces source!

The patch I ve make is about 10 lines of code in one class of xerces.

I think it is an important functionality whereas it is not specified into
XML specs. I'm ready to work in xerces to add this functionnality in the
native srcs. What is the way to propose new features ?


NOTE : my patch is not well tested but I can publish it there if you  are
interested in.

Regards ,

Christophe Brethes


-----Message d'origine-----
De : thor@mail.phoenixcolor.com [mailto:thor@mail.phoenixcolor.com]De la
part de John Thorhauer
Envoyé : lundi 28 août 2000 16:53
À : xerces-j-dev@xml.apache.org
Objet : dynamically adding a DTD


Does anyone no if it is possible to programmatically attatch a DTD to an
xml document at runtime if the document has no DTD reference in the
doctype declaration?

I figured out how to change the dtd if it is already specified in the
orginal xml doc but I want to be able to specify a dtd for an xml
document that has no dtd.

I have tried setting the doctype to <!DOCTYPE envelope SYSTEM "">  but I
get a file not found error before my resolveEntity() method is called.
So I tried setting dock type to <!DOCTYPE envelope > and then set xml
validation to true but then resolveEntity() is never called and I can
not specify a dtd.

Any ideas on how to do this?

Thanks,
John
--
********************************
** John Thorhauer
** jthorhauer@phoenixcolor.com
********************************

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org