xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chirdeep Sharma <chird...@excite.com>
Subject Xalan in JSP
Date Fri, 16 Mar 2001 19:00:34 GMT

Hi,


I am having a problem using Xalan from a JSP. A JSP passes XML string and
XSL
path to the transform routine and it gives an error:
java.lang.NoSuchMethodError: java.lang.String
org.w3c.dom.Node.getLocalName()
	void org.apache.xalan.transformer.TransformerImpl.run()log3: 
	void java.lang.Thread.run()log3: 

The Same program works fine standalone using the same calls. Following are
the
snippets:

------JSP Call--------
// result is the XML string to be tranformed to HTML....

    result = SimpleTransform.transform(result, "file:///C:/Program
Files/Oracle/JDeveloper 3.2/myhtml/welcome_html/untitled1.xsl");


--The transform method-------

  public static java.lang.String transform(java.lang.String xml,
java.lang.String xslPath)
    throws TransformerException, TransformerConfigurationException,
           FileNotFoundException, IOException {

            System.out.println("XSLPATH: " + xslPath);
            StringReader reader = new StringReader(xml);
  
           	TransformerFactory tFactory = TransformerFactory.newInstance();
            Transformer transformer = tFactory.newTransformer(new
StreamSource(xslPath));
            StringWriter writer = new StringWriter();
            StreamResult streamResult = new StreamResult(writer);
          	transformer.transform(new StreamSource(reader), streamResult);
            System.out.println("Output: " + streamResult.getWriter());
            return ((StringWriter)streamResult.getWriter()).toString();
  }

---------The System.out log for XSL Path:----------

log3: XSLPATH: file:///C:/Program Files/Oracle/JDeveloper
3.2/myhtml/welcome_html/untitled1.xsl





_______________________________________________________
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/



---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message