How to get XSLT work with Tamino's DOM?

Hi!

Has anyone solved the problem as follows

I’m getting stuff out of Tamino and I’d like to do XSLT transformation on it. The language used is Java. The problem is that I can’t make Xalan to accept DOM-tree got from Tamino as a source. I’ve tried xalan versions 1.3 and xalan-java 2.2.D11.

With version 1.3 the error messages I get is like “Xalan with xercesParserLiason is unable to work with Node type of BasicDocument”

And with 2.2.D11 I get some weird exception? Here’s the stack dump:
– dump starts -----
java.lang.AbstractMethodError
at org.apache.xpath.DOM2Helper.getLocalNameOfNode(DOM2Helper.java:326)
at org.apache.xalan.templates.TemplateList.getHead(TemplateList.java:471)
at org.apache.xalan.templates.TemplateList.getTemplate(TemplateList.java:528)
at org.apache.xalan.templates.StylesheetRoot.getTemplateComposed(StylesheetRoot.java:707)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2049)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1246)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:504)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1174)
at test.tamino.testFrame.main(testFrame.java:139)
– dump ends —


So has anyone find some XSLT-processor which is able to work with Tamino-based DOMs without serializing them first?? Ideas and source code examples would be very much appreciated.

Thanks in advance!

Hi,

the API you’re using wants to use the Docuverse DOM implementation, hence the incompatibility.

I recommend using TaminoDOM-API 3 posted by Nigel Hutchison in this forum:

Tamino Developer Community Home

Example with DOM API 2 and a transformation:

code:
 
import org.w3c.dom.;
import com.softwareag.tamino.API.dom2.
;
import java.util.;
import java.io.
;

public class ApiTest {

public static void main(String args) {

try {
TaminoClient tc = new TaminoClient(“http://localhost/tamino/ino23/Telephone”);
TaminoResult tr = tc.query(“Telephone[@ino:id=1]”);
Enumeration e = tr;

while ( e.hasMoreElements() ) {

Element r = (Element) e.nextElement();

TaminoClient.printTree(r);

// 1. Instantiate a TransformerFactory.
javax.xml.transform.TransformerFactory tFactory =
javax.xml.transform.TransformerFactory.newInstance();

// 2. Use the TransformerFactory to process the stylesheet Source and
// generate a Transformer.
javax.xml.transform.Transformer transformer = tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource(<> ));

// 3. Use the Transformer to transform an XML Source and send the
// output to a Result object.
transformer.transform
(new javax.xml.transform.dom.DOMSource(r),
new javax.xml.transform.stream.StreamResult(System.out));

}
} catch (Exception e) {
e.printStackTrace();
}
}
}



Best regards, Andreas