|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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@xxxxxxxx]
> Sent: Friday, April 28, 2000 9:26 AM
> To: XSL-List@xxxxxxxxxxxxxxxx
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








