xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Hersht <ig...@ca.ibm.com>
Subject Re: Processing xml without dtd
Date Mon, 17 May 2004 18:04:43 GMT




I think this question should be redirected to
xerces-j-user@xml.apache.org
As far as I remember Xerses has options to ignore unreachable (or
unavailable) DTD.


Igor Hersht
XSLT Development
IBM Canada Ltd., 8200 Warden Avenue, Markham, Ontario L6G 1C7
Office D2-260, Phone (905)413-3240 ; FAX  (905)413-4839


                                                                           
             Marco                                                         
             <brbromo@tin.it>                                              
                                                                        To 
             05/14/2004 10:57          xalan-j-users@xml.apache.org        
             AM                                                         cc 
                                                                           
                                                                   Subject 
                                       Processing xml without dtd          
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Is it possible to process xml files with unreachable (or unavailable) DTDs?
Even using a non-validating sax parser as source, xalan still throws
the

javax.xml.transform.TransformerException: java.io.FileNotFoundException:
office.dtd

where office.dtd is the input file dtd.
Here's the source:

SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(false);
spf.setNamespaceAware(true);
XMLReader xmlr = spf.newSAXParser().getXMLReader();
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer(new StreamSource("notes.xsl"));
t.transform(new SAXSource(xmlr, new InputSource("content.xml")), new
StreamResult("output.html"));

Thanks in advance,
Marco




Mime
View raw message