cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Reynolds <li...@va.com.au>
Subject Sending a parameter to Xerces (allow java char encodings)
Date Wed, 17 Jul 2002 15:23:24 GMT
Hi

I'm trying to get Xerces 2 (that comes with Cocoon 2.0.2) to parse 
MacRoman encoded xml files.

According to the Xerces FAQ 
(http://xml.apache.org/xerces2-j/features.html) you can run the 
following java code to tell it to recognise and process all character 
encodings suppored by Java. The linux-jdk1.2.2 that I'm using does 
support MacRoman encoded text, so this is, of course, what I want to 
do:


import javax.xml.parsers.SAXParser;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

SAXParser parser = /* created from SAXParserFactory */;
XMLReader reader = parser.getXMLReader();
try {
     reader.setFeature("http://xml.org/sax/features/allow-java-encodings",
                       true);
}
catch (SAXException e) {
     System.err.println("could not set parser feature");
}


Question is, how the hell to I tell Cocoon (or Tomcat????) to run 
this Java code after loading the Xerces parser?

Is there any easier way to tell Xerces to allow java encodings, eg a 
config file or something???

Thanks very much

Jesse

-- 
       Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au

     Email: jesse (at) va.com.au            > Website Development
     Phone: +61 (0)8 8223 2288              > Web & Email Hosting
       Web: http://jesse.va.com.au          > Streaming Media Hosting
                                            > Telehousing / Colocation

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message