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]

Reply via email to