I don't think it is trivial...

AFAIK there is no way to say to a parser "ignore the DTD".
Validating is one thing but loading the DTD is another.

As there is no way to really know what the DTD is for (could be to resolve
some entities)
There is one step to this by specifying an XML document as standalone in the
declaration:
<?xml standalone="yes">

but I believe this is very parser dependent. For instance Crimson has a
specific feature 'fastStandalone' that can only be set by accessing the
Parser2 instance...
(and I think this is half implemented, not sure)

One common hack is to perform a replace in the document to remove/comment
the doctype tag...
This is also why a regex replace is your friend...

-- 
 Stéphane Bailliez 
 Software Engineer, Paris - France 
 iMediation - http://www.imediation.com 
 Disclaimer: All the opinions expressed above are mine and not those from my
company. 



> -----Original Message-----
> From: Erik Hatcher [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 07, 2001 10:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Turning off XML validation is Style task
> 
> 
> There currently is no way to turn off validation for the 
> <style> task, but
> that seems like a reasonable feature request.
> 
> Its probably a fairly trivial modification... patches always 
> welcome!  :)
> 
>     Erik
> 
> 
> ----- Original Message -----
> From: "McCollum , Angus" <[EMAIL PROTECTED]>
> To: "Ant User (E-mail)" <[EMAIL PROTECTED]>
> Sent: Friday, September 07, 2001 9:35 AM
> Subject: Turning off XML validation is Style task
> 
> 
> > Is there a way to turn off XML validation in a Style task?
> >
> > In particular I want to process a set of XML documents that 
> use a public
> > document type. The Style task can find the DTD and produces 
> the error
> below:
> >
> > >ant
> >
> > Buildfile: build.xml
> >
> > outline:
> >     [style] Transforming into C:\outline
> >     [style] Transforming into C:\outline
> >     [style] Loading stylesheet C:\outline\outline.xsl
> >     [style] Failed to process T:\Documents\Problems.xml
> >
> > BUILD FAILED
> >
> > C:\outline\build.xml:9: javax.xml.transform.TransformerException:
> > java.io.FileNotFound
> > Exception: T:\Documents\mathnote.dtd (The system cannot 
> find the file
> > specified)
> >
> > Total time: 2 seconds
> >
> 

Reply via email to