ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <sbaill...@imediation.com>
Subject RE: Turning off XML validation is Style task
Date Fri, 07 Sep 2001 21:12:24 GMT

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:erikhatcher@earthlink.net]
> Sent: Friday, September 07, 2001 10:58 PM
> To: ant-user@jakarta.apache.org
> 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" <AMcCollum@grow.net>
> To: "Ant User (E-mail)" <ant-user@jakarta.apache.org>
> 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
> >
> 

Mime
View raw message