This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Please help with XT


If you are using jclark's XT. Here is the piece of code which we use
for XSL transformation is servlets.

Note: DMWriteErrorLog is our custom class used for logging debug statements.

      // Parse xsl and xml documents
      Class clasz = Class.forName(com.jclark.xml.sax.Driver);
      Parser parser = (Parser) clasz.newInstance();

      XSLProcessor xslProcessor  = new XSLProcessorImpl();
      xslProcessor.setParser(parser);

      // load the stylesheet
      Reader rdr = (Reader) (new FileReader(XslFilePath));

      InputSource inpS_StyleSheet = new InputSource(rdr);
      DMWriteErrorLog.writeError(METHOD_NAME + "After Creating Input Source
");
      xslProcessor.loadStylesheet(inpS_StyleSheet);
      DMWriteErrorLog.writeError(METHOD_NAME, "Load the StyleSheet");

      // set the output destination
      OutputMethodHandlerImpl outputMethodHandler = new
OutputMethodHandlerImpl(xslProcessor);
      xslProcessor.setOutputMethodHandler(outputMethodHandler);
      outputMethodHandler.setDestination(new ServletDestination(res));

      // xml string
      StringReader strRdr = new StringReader(strXML);
      org.xml.sax.InputSource inpS_Xml = new
org.xml.sax.InputSource(strRdr);
      DMWriteErrorLog.writeError(METHOD_NAME, "Applying XSL");

      try {
         xslProcessor.parse(inpS_Xml);
      }
      catch (Exception ex) {
         DMWriteErrorLog.writeError(METHOD_NAME, " Error in parsing : " +
ex.getMessage());
         throw new Exception(ex.getMessage());
      }


- Prasad

> -----Original Message-----
> From:	Maksim Zhizhkun [SMTP:maksims@swh-t.lv]
> Sent:	Friday, April 28, 2000 9:26 AM
> To:	XSL-List@mulberrytech.com
> Subject:	Please help with XT
> 
> Does anyone could send some piece of code as an example of XT parser usage
> for XSLTransformation.
> I cannot find any documentation on it.
> I've tried many variants of code but always got  an XSL in result doc for
> both SAX and DOM models.
> Could someone recommend some good source of information regarding XT
> usage?
> 
> I'll be appreciated for any help,
> Max
> 
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]