RE: Mixing XSL stylesheet and Java handlers in Saxon

Subject: RE: Mixing XSL stylesheet and Java handlers in Saxon
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Fri, 17 Dec 1999 17:02:37 -0000
> Thank you for these tips, but in fact what I would like, is loading
> a stylesheet in my Java program. This stylesheet would give me basic
> template rules. Then according to some parameters, my program would
> define some additional node handlers.

I think this will be reasonably easy in the next version, which is
undergoing final testing. This will allow you to use the logic:

PreparedStyleSheet ps = new PreparedStyleSheet();
ps.prepare(new InputSource("style.xsl"))
RuleManager rm = ps.getRuleManager();
Pattern p = Pattern.make("html");
rm.setHandler(p, new HtmlNodeHandler());
StyleSheetInstance ssi = ps.makeStyleSheetInstance();
ssi.renderSourceDocument(new InputSource("source.xml"));

I didn't design the interface with that in mind, but it comes out quite

By the way, it might be a courtesy to others on this list if specialised
SAXON discussions are conducted on

Mike Kay

 XSL-List info and archive:

Current Thread