XML/XSL Processing & Transformation

Hi

I have a XML & a XSL as strings - need to transform XML into HTML.

Here is a part of the code I am using.

com.lotus.xsl.XSLTInputSource oipXML = new com.lotus.xsl.XSLTInputSource(new ByteArrayInputStream(strXML.getBytes()));

com.lotus.xsl.XSLTInputSource oipXSL = new com.lotus.xsl.XSLTInputSource(new ByteArrayInputStream(strXSL.getBytes()));

com.lotus.xsl.XSLTResultTarget oxtOut = new com.lotus.xsl.XSLTResultTarget(objPrnWtr);

com.lotus.xsl.XSLProcessor oxpProc = new com.lotus.xsl.XSLProcessor();

oxpProc.process (oipXML, oipXSL, oxtOut);

Compiles ok but when I run this (I have tried it as a notes agent as well as a .java file) I get errors.

Pasted below is a copy of the errors it gives when I use it in a java file.

java.lang.NoClassDefFoundError: org/apache/xerces/framework/XMLParser

    at java.lang.Class.forName0(Native Method)

    at java.lang.Class.forName(Class.java:130)

    at org.apache.xalan.xslt.XSLTEngineImpl.<init>(Unknown Source)

    at com.lotus.xsl.XSLProcessor.<init>(Unknown Source)

    at test.blTrm(test.java:48)

    at test.main(test.java:21)

Exception in thread “main”

Any help will be highly appreciated.

Best regards

Puneet

Subject: XML/XSL Processing & Transformation (IBM - Bug??)

Hi allI have figured out where the problem is & what the problem is.

The code falls over when trying to create a new XSL processor.

com.lotus.xsl.XSLProcessor oxpProc = new com.lotus.xsl.XSLProcessor();

The error is:

java.lang.NoClassDefFoundError: org/apache/xerces/framework/XMLParser

It seems to be a problem with the actual classes in the archive file.

I am using the LotusXSL.jar that is shipped with R6.02CF1 of Domino.

Has anyone had this problem before.

Regards

Puneet

Subject: XML/XSL Processing & Transformation - Fixed !!

For those interested, I have got it to work !

This is how a new instance of XSLProcessor should be created:

XSLProcessor objXSLProc = new XSLProcessor(new com.lotus.xml.xml4j2dom.XML4JLiaison4dom());

Using XSLProcessor objXSLProc = new XSLProcessor() will compile ok but fail execution.

I think we need to have some sort of (online) documentation for IBM XML4J parser and Lotus XSL processor classes.

Regards…