xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Liviu Casapu <li...@savvion.com>
Subject Re: transform xml with unreachable dtd
Date Thu, 08 May 2003 18:27:57 GMT


Hi Andrew,

I've had the same problem not a long time ago. One way to work around it
is to use a DOM/SAXSource instead of a regular StreamSource. This way,
Xalan does not invoke the XML parser automatically, because you do it
beforehand. Depending on your needs, you can specify an alternate DTD (or 
the same one but from a different location), or elect not to use one
during parsing.

Hope it helps,
Liviu

> 
> Hi,
> 
> I am trying to transform an xml file with a doctype that references a dtd that wont be
available at the point of transform.  Is it possible to still transform the xml?
> 
> <?xml version="1.0" ?>
> <!DOCTYPE foo
>   SYSTEM "ini.dtd">
> <foo>
> </foo>
> 
> Currently I get the error: 
> 
> java.io.FileNotFoundException: T:\omi transform\ini.dtd (The system cannot find the file
specified)
> java.io.FileNotFoundException: T:\omi transform\ini.dtd (The system cannot find the file
specified)
>         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
>         at org.apache.crimson.parser.Parser2.externalParameterEntity(Parser2.java:2870)
>         at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1167)
>         ....
> 
> I have tried using 
> 
> xf.setFeature("http://xml.org/sax/features/external-parameter-entities",false);
> 
> where xf is the XMLFilter, but crimson doesnt support this feature.  After reading around
Ive kind of got the impression that the DTD must be available if it is specified otherwise
the transform should fail (as the xml needs it resolve entities etc).
> 
> How can I get the xml to parse without the dtd being available?
> 
> cheers
> andrew
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.470 / Virus Database: 268 - Release Date: 08/04/2003
>  
> 



Mime
View raw message