Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 86509 invoked from network); 7 Feb 2000 18:17:23 -0000 Received: from mailgate.icl.co.uk (HELO ws2.icl.co.uk) (194.176.223.195) by locus.apache.org with SMTP; 7 Feb 2000 18:17:23 -0000 Received: from mailgate.icl.co.uk (mailgate [172.16.2.3]) by ws2.icl.co.uk (8.8.8/8.8.8) with ESMTP id SAA19594 for ; Mon, 7 Feb 2000 18:18:47 GMT Received: from vguard1.icl.co.uk (vguard1.icl.co.uk [145.227.248.91]) by mailgate.icl.co.uk (8.9.3/8.9.0) with SMTP id SAA21250 for ; Mon, 7 Feb 2000 18:16:14 GMT Received: FROM x400.icl.co.uk BY vguard1.icl.co.uk ; Mon Feb 07 18:18:55 2000 0000 Received: from fel01suksmsg2.icl.com (fel01suksmsg2.icl.com [145.227.201.50]) by x400.icl.co.uk (8.9.3/8.9.2) with ESMTP id SAA23980; Mon, 7 Feb 2000 18:16:08 GMT Received: by FEL01SUKSMSG2 with Internet Mail Service (5.5.2650.21) id ; Mon, 7 Feb 2000 18:17:29 -0000 Message-ID: <93CB64052F94D211BC5D0010A800133101FDEA0C@wwmess3.bra01.icl.co.uk> From: Kay Michael To: "'Scott Boag/CAM/Lotus'" , xalan-dev@xml.apache.org Cc: Kay Michael , cocoon-dev@xml.apache.org, xalan-dev@xml.apache.org, James Clark , Steve Muench , Adam Winer , Assaf Arkin , Eduardo.Pelegrillopart@eng.sun.com Subject: RE: XSLT API Proposal (Draft 2) Date: Mon, 7 Feb 2000 18:16:45 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" > Huh? Not at all... Transform represents the compiled stylesheet. > XSLTExecContext was meant to represent a session context for the XSLT > processor. That's the trouble with these abstract names: people can come to wrong conclusions! I had worked out that I had come to the wrong conclusion, but hadn't worked out exactly where I was wrong. I don't currently have anything corresponding to XSLTProcessor, but I think I now understand what it is, and that that is the right name. Saxon's PreparedStyleSheet corresponds to your Transform. Saxon's StyleSheetInstance corresponds to your TransformContext. Both horrible names. How about Processor, Transformer, and Transformation? That gets across the idea that one transformer can do many transformations. Following this I'm now thinking along the lines of: XSLTProcessor processor = new Saxon(); Transformer transformer = processor.makeTransformer(new XSLTInputSource("style.xsl")); for (i=0; i<100; i++) { OutputProperties oprop = new OutputProperties(); oprop.setEncoding("iso-8859-1"); oprop.setIndent("yes"); // or true, I don't care oprop.setWriter(writer[i]); oprop.setProperty("urn:user.com/property-A", "bananas"); oprop.setProperty("http://org.apache.xalan/line-terminator", "\n"); oprop.setProperty("http://com.icl.saxon/indent-spaces", "3"); OutputMethod omethod = new UserDefinedOutputMethod(); oprop.setOutputMethod(omethod); transformation = transformer.makeTransformation(); transformation.setParameter("name", "value"); transformation.process(new XSLTInputSource(uri[i]), oprop); String mime = oprop.getMediaType(); } This is the easy case. In Saxon I have a Builder class and a DocumentInfo class. DocumentInfo sourceDoc = (new Builder()).build(inputSource); transformation.process(sourceDoc, oprop); Then I can also do things like (this is next release stuff, adapted to the terminology above) DocumentInfo sourceDoc = (new Builder()).build(inputSource); String styleURI = sourceDoc.getAssociatedStylesheet(); if (styleURI.startsWith('#')) { transformer = sourceDoc.getEmbeddedStylesheet(styleURI.substring(1)); } else { transformer = processor.makeTransformer(new XSLTInputSource(styleURI)); } (transformer.makeTransformation()).process(sourceDoc, oprop); Mike Kay