> From: Jesse Reynolds [mailto:[EMAIL PROTECTED]]
> 
> 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?

Cocoon does not know about this feature ATM. If you don't mind, you can
patch JaxpParser.java to take <allow-java-encodings/> configuration
element and set this feature to the parser.

Vadim


> 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


---------------------------------------------------------------------
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:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to