You are now running the Xalan XSLT engine but with the AElfred XML parser. AElfred is selected as the XML parser because of the property settings in force, but you also need to set system properties or your classpath to ensure that Saxon is the selected XSLT engine. Specifically, the property javax.xml.transform.TransformerFactory must be set to com.icl.saxon.TransformerFactoryImpl.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Chandrasekhar, Prabhu
Sent: 28 March 2006 20:37
To: saxon-help@lists.sourceforge.net
Subject: [saxon] RE: Saxon and Weblogic 8.1 compatibility issues?

I found that in Weblogic 8.1 I cannot do a System.setProperty runtime. I have to set the sax-parser-factory amongst other properties in the weblogic-application.xml. At this point it recognized the sax parser but I am getting this error instead of the old one.
 
java.io.EOFException: no more input
at org.apache.xalan.transformer.TransformerImpl.fatalError(TransformerImpl.java:741)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:715)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
 
which itself is related to this stack trace further down below -
java.io.EOFException: no more input
        at com.icl.saxon.aelfred.XmlParser.popInput(XmlParser.java:4076)
        at com.icl.saxon.aelfred.XmlParser.pushURL(XmlParser.java:3613)
        at com.icl.saxon.aelfred.XmlParser.doParse(XmlParser.java:159)
        at com.icl.saxon.aelfred.SAXDriver.parse(SAXDriver.java:320)
        at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
 
The second one helps me understand that the saxon parser factory is being used. These are the settings for the weblogic-application.xml I used -
<xml>
      <parser-factory>
        <saxparser-factory>com.icl.saxon.aelfred.SAXParserFactoryImpl</saxparser-factory>
      </parser-factory>
      <entity-mapping>
        <entity-mapping-name>My Mapping</entity-mapping-name>
        <cache-timeout-interval>0</cache-timeout-interval>
      </entity-mapping>
    </xml>
Any help will be really appreciated. Mike, can you see anything strange in the code I have used below. I have tried DOM, I have tried serializing the DOM to a string
and sending that as a stream. I have tried File input as well. Nothing has worked.
 
Thanks


From: Michael Kay [mailto:michael.h.kay@ntlworld.com]
Sent: Monday, March 27, 2006 1:39 PM
To: Chandrasekhar, Prabhu
Cc: saxon-help@lists.sourceforge.net
Subject: RE: Saxon and Weblogic 8.1 compatibility issues?

Please don't go off-list! It's important that someone finding the question in the archive can also find the answer.
Thanks for your email. I shall try and upgrade the version. How would I remove the dependency on DOM? What would be the alternative? File parsing?  
 
It rather depends where the data comes from. If you are building a DOM specially in order to pass it to Saxon, that's already very inefficient and it would be much better to pass a file or a SAX event stream. If the DOM exists because your application needed the data in this form, then Saxon 6.x. is going to copy the whole DOM into its own internal tree format, and it won't be any slower if you do this process yourself, typically by generating a SAX stream from the DOM and passing the SAX stream to Saxon.
 
Hopefully this won't be necessary, because Saxon 6.5.5 was tested with the DOM implementations in JDK 1.4 and 1.5. But this could well be the source of the problem, since DOM implementations have varied considerably from one Java release to the next.
 
Michael Kay
http://www.saxonica.com/
 
 
 
Prabhu


From: Michael Kay [mailto:michael.h.kay@ntlworld.com]
Sent: Monday, March 27, 2006 12:53 PM
To: Chandrasekhar, Prabhu
Subject: RE: Saxon and Weblogic 8.1 compatibility issues?

Saxon 6.4.3 is nearly five years old (released 2001-07-13) and there have been many bugs fixed since then; there have also been many changes to Java, JAXP, and DOM, some of them introducing incompatibilities with the versions that were current when 6.4.3 was tested. Your first step should therefore be to move to Saxon 6.5.5.
 
If that doesn't fix the problem we'll have to start investigating. It won't be easy, because I don't have the ability to test under Weblogic.
 
I notice that you're taking input from a DOM. That's always been one of the less reliable features in Saxon because of the differences between different DOM implementations and versions. It might be worth changing the code to remove this dependency on DOM, if only to see whether this fixes the problem. 
 
Michael Kay
http://www.saxonica.com/


From: Chandrasekhar, Prabhu [mailto:pchandrasekhar@analytika.com]
Sent: 27 March 2006 18:16
To: michael.h.kay@ntlworld.com
Subject: Saxon and Weblogic 8.1 compatibility issues?

Hi Michael,
I have used Saxon 6.4.3 parser with Tomcat and Apache server and I used this snippet of code to transform a DOM to XML using a stylesheet

TransformerFactory tfact = TransformerFactory.newInstance();
    Transformer trans = null;
System.setProperty("javax.xml.parsers.SAXParserFactory","com.icl.saxon.aelfred.SAXParserFactoryImpl");
    if (styleSheetName == null)//null transformation to result
    {
      trans = tfact.newTransformer();
      trans.setOutputProperty(OutputKeys.ENCODING,"ascii");
      trans.transform(new DOMSource((Node) dom), new StreamResult (bResultWriter));
    }
    else //apply stylesheet
    {
      System.out.println("Stylesheet = " + styleSheetName);
      StreamSource styleSource = new StreamSource(new File(styleSheetName));
      trans = tfact.newTransformer(styleSource);
      trans.setOutputProperty(OutputKeys.INDENT,"yes");
      trans.setOutputProperty(OutputKeys.METHOD,"xml");
      trans.transform(new DOMSource((Node)dom),new StreamResult(bResultWriter));
    }

Everything was fine but we have decided to use an enterprise level server and so we are migrating all pieces of code to Weblogic 8.1 SP5. However, this segment of code runs smoothly (no error reports or stacktraces) but for some reason the XSLT would not parse it correctly. It loses the node structure and gives out only a string object. It loses all the start and end tags and only the value of the attributes. Am I doing something wrong or do I need to change something?

Thanks for your help
Prabhu Chandrasekhar
Sr. Programmer, Analytika
Dendrite International, Inc.
Phone: 919-549-0270 ext. 4867
Fax: 919-549-0271
Email: pchandrasekhar@analytika.com
Web: http://www.dendrite.com