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

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

    kennethp

      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

        • 1. Re: xslt transformation - org.xml.sax.SAXParseException: Cha
          kennethp

          I am sorry that I posted in this forum, as JCA clearly has nothing to bo with my problem. I was tired when creating the post.

          I have solved the problem my self. It turns out that the DTD of the document I was trying to transform was not well formed. It seems that while JBoss tries to validate the xml-document before parsing, Tomcat does not.

          Regards
          Kenneth Petersen