I have a custom tag who's source looks like this perhaps you can try this

private String xmlTransform(String xmlin)
    throws MalformedURLException, FileNotFoundException, IOException,
      SAXException {

      InputStream styleSheetInputStream = null;

      try {
        XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
        XSLTInputSource xmlSource = new XSLTInputSource(new
StringReader(xmlin));

        URL ssURL = new URL(stylesheetURL);
        styleSheetInputStream = ssURL.openStream();
        //styleSheetInputStream =
pagebContext.getServletContext().getResourceAsStream(stylesheetURL);
        XSLTInputSource xslStylesheet = new
          XSLTInputSource(styleSheetInputStream);
        StringWriter transformationWriter = new StringWriter();
        XSLTResultTarget xmlOutput = new
XSLTResultTarget(transformationWriter);
        processor.process(xmlSource, xslStylesheet, xmlOutput);
        return transformationWriter.toString();
      }
      finally {
        if (styleSheetInputStream != null) {
          styleSheetInputStream.close();
        }
      }
  }

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Lindsay, William (BIS)
> Sent: Friday, March 30, 2001 1:09 PM
> To: [EMAIL PROTECTED]
> Subject: Re: using Xalan/Xerces in a servlet
>
>
> Have you tried doing a transform from the command line with
>
> java org.apache.xalan.xslt.Process -IN %1 -XSL %2 -OUT %3
>
> // I copied this from a BAT file.
>
> Bill Lindsay
> Benefits and Investment Solutions
> 401(k) Infrastructure Automation
>
>
> -----Original Message-----
> From: ARPON Martín DST [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 30, 2001 2:51 PM
> To: [EMAIL PROTECTED]
> Subject: using Xalan/Xerces in a servlet
>
>
> I 'm writing a simple servlet to transform xml into html
> according to a xsl.
>
>
> The code is:
>
>                         TransformerFactory tFactory =
> TransformerFactory.newInstance();
>
>                         Transformer transformer = tFactory.newTransformer(
>                                 new StreamSource("prueba.xsl"));
>
>                         transformer.transform(
>                                 new StreamSource("prueba.xml"),
>                                 new StreamResult(new
> FileOutputStream("prueba.html")));
>
>
> But I 'm getting the following exception:
>
> javax.xml.transform.TransformerConfigurationException: Namespace not
> supported by SAXParser at
> org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(T
ransformer
> FactoryImpl.java:650)
> at xml2html.doGet(xml2html.java:27)
>
> Can anybody help ?
>
> TIA,
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to