1 Reply Latest reply on Sep 29, 2002 4:41 AM by Kenneth Petersen

    xslt transformation - org.xml.sax.SAXParseException: Charact

    Kenneth Petersen Newbie

      Hi,

      I am not sure if this is the correct forum for this question, but here I go:

      I am trying to access and transform an xml document. I have developed a test class able to perform the desired actions, if I execute the class from my development environment (the code follows at the end of this mail). My problem is that if I execute the same class from a session-bean, I get the following exception:

      14:27:50,837 INFO [STDOUT] javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: Character conversion error: "Illegal ASCII character, 0xf6" (line number may be too low).
      at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:686)
      at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
      at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
      at com.travis.util.xml.XSLTHelper.process(XSLTHelper.java:111)


      The code that has successfully been executed from Tomcat and my IDE (Netbeans):

      // 1. Retrive document to be transformed
      URL url = new URL("http://www.netbook.se/fsi/index?_ID=login.no_group&userId=nbpeder&pwd=fsiuser");
      URLConnection connection = url.openConnection();
      InputStream stream = connection.getInputStream();

      // 2. Instantiate a TransformerFactory. The factory instantiated is
      //determined by system property "javax.xml.transform.TransformerFactory".
      TransformerFactory tFactory = TransformerFactory.newInstance();

      // 3. Use the TransformerFactory to process the stylesheet Source and
      // generate a Transformer.
      Transformer transformer = tFactory.newTransformer(xsl);

      // 4. Use the Transformer to transform an XML Source and send the
      // output to a Result object.
      transformer.transform(new StreamSource(stream), writer);



      I am using JBoss 3.0.2. I have places Xalan 2.4.0 and Xerces 2.1.0 in the JBoss//default/lib folder.


      Any suggestions as to what the problem is would be much appreciated.

      Regards
      Kenneth