Use of jfor with WebObjects, an environment having it's own xerces parser

Dominique Schoenenberger <[email protected]> Tue, 9 Nov 2004 13:31:57 +0100
Newsgroups gmane.text.xml.jfor.general
Message-ID <[email protected]>
I want to use jfor with WebObjects. WebObjects has it's own classloader  
and contains a xerces version inside it's jar files.

Adding the jfor jar to WebObjects is not directly working because it  
produce a class not found exception:  
"org.apache.xerces.parsers.SAXParser" not found.

If you look at org.jfor.jfor.converter.ConverterOption.java, the  
getXmlReader() method has a comment saying that we can override it to  
use a different parser.

I try to subclass it but the class is not public and I finally copy the  
whole class. (would it be possible to add public or protected to the  
class in order to better subclass it ?).

Here is the modified getXmlReader method of my new ConverterOption:


public XMLReader getXmlReader() throws Exception
{
	final XMLReader reader =  
(XMLReader)_NSUtilities.classWithName("org.apache.xerces.parsers.SAXPars 
er").newInstance();
	return reader;
}

We see that the problem with WebObjects is more related to the use of  
the class loader !?

And then I use my new ConverterOption in the following way to convert  
xsl-fo to rtf:

			new Converter(bais,new OutputStreamWriter(baos), new  
MyNewConverterOption());


Dominique



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click