You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Colin W. Kingsbury" <co...@empolis-na.com> on 2003/03/11 01:25:00 UTC

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: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Way to make XML generator ignore DTD declaration?

Posted by Jeff Turner <je...@apache.org>.
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: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Way to make XML generator ignore DTD declaration?

Posted by Martin Holz <ho...@fiz-chemie.de>.
"Colin W. Kingsbury" <co...@empolis-na.com> 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     <ho...@fiz-chemie.de>

Softwareentwicklung / Vernetztes Studium - Chemie
FIZ CHEMIE Berlin
Franklinstrasse 11
D-10587 Berlin     


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org