Way to make XML generator ignore DTD declaration?
Hi all, I have an XML document which includes a dtd declaration like so: !DOCTYPE foo PUBLIC -//foo//foo document//EN foo.dtd [ !ENTITY bar bar ]foo/foo Everything works fine -if- I delete the DTD declaration. But only if... I don't care about validity but problem is the source file is generetd by a dump from a CMS which insists on having the declaration like so. I tried putting the DTD in the same dir as the content XML, etc etc but no luck. Is there any setting which can force the parser to ignore DTDs or another place I should be putting the DTD file? I'd rather not write a nasty little parser just to strip out the doctype declaration... Thanks in advance, -cwk. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Way to make XML generator ignore DTD declaration?
On Mon, Mar 10, 2003 at 07:25:00PM -0500, Colin W. Kingsbury wrote: Hi all, I have an XML document which includes a dtd declaration like so: !DOCTYPE foo PUBLIC -//foo//foo document//EN foo.dtd [ !ENTITY bar bar ]foo/foo Everything works fine -if- I delete the DTD declaration. But only if... I don't care about validity but problem is the source file is generetd by a dump from a CMS which insists on having the declaration like so. I tried putting the DTD in the same dir as the content XML, etc etc but no luck. Is there any setting which can force the parser to ignore DTDs or another place I should be putting the DTD file? I'd rather not write a nasty little parser just to strip out the doctype declaration... Heh.. well if it helps, here's a 'nasty little parser' already written, to do just this job: http://doctypechanger.sf.net/ The javadocs explain why (I think) this sort of hack is the only real solution. If you prefer, Xerces XNI pull parsing can do the same thing. It would be pretty easy to work this into a DOCTYPEMungingFileSource in Excalibur. --Jeff Thanks in advance, -cwk. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Way to make XML generator ignore DTD declaration?
Colin W. Kingsbury [EMAIL PROTECTED] writes: Hi all, I have an XML document which includes a dtd declaration like so: !DOCTYPE foo PUBLIC -//foo//foo document//EN foo.dtd [ !ENTITY bar bar ]foo/foo Everything works fine -if- I delete the DTD declaration. But only if... I don't care about validity but problem is the source file is generetd by a dump from a CMS which insists on having the declaration like so. I tried putting the DTD in the same dir as the content XML, etc etc but no luck. Is there any setting which can force the parser to ignore DTDs or another place I should be putting the DTD file? I'd rather not write a nasty little parser just to strip out the doctype declaration... Tell the catalog entity revolver to always prefer the public id and direct it to your local file system. See http://xml.apache.org/cocoon/userdocs/concepts/catalog.html -- Martin Holz [EMAIL PROTECTED] Softwareentwicklung / Vernetztes Studium - Chemie FIZ CHEMIE Berlin Franklinstrasse 11 D-10587 Berlin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]