cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Muench" <smue...@us.oracle.com>
Subject Re: XSLT API Proposal (Draft 2)
Date Tue, 08 Feb 2000 22:03:30 GMT
I didn't mean to imply that I liked Stylesheet better than Transform
as the Java name. I just thought that what's the user's point of view
understands. I personally like Transform better for the java class.

I've changed Stylesheet back to Transform and have a few questions:

| import org.xml.xslt.*;  // Or whatever...
|
| TransformFactory sfactory = XSLTFactory.newTransformFactory(...);
| 
| Params params = new Params();  // Bag of params..
| params.set("foo", "http://foo.com", "hello");

What's the third argument here? Name, Value, ??

| Transform    trans1 = tfactory.createTransform(new InputSource("t1.xsl");
| XSLTProcessor proc1 = trans1.getProcessor();

Do you mean createProcessor() here? getProcessor() sounds like getting
your hands on a singleton.

|   :
| proc3.setResultTarget(new Result(System.out), oprop));
| proc2.setResultTarget(new Result(proc3), oprop));
| 
| proc1.process(new InputSource("foo.xml"), params, new Result(proc2), null);

Is new Result(proc2) a new constructor that accepts an XSLTProcessor?

You have used newTransformFactory() and createTransform()
Should we standardize on either "newXX" or "createXXX" ?

__________________________________________________________
Steve Muench, Lead XML Evangelist / Consulting Product Mgr
Oracle Corp, Business Components for Java Development Team
http://technet.oracle.com/tech/xml
----- Original Message ----- 
From: "Scott Boag/CAM/Lotus" <Scott_Boag@lotus.com>
To: <cocoon-dev@xml.apache.org>
Cc: <xalan-dev@xml.apache.org>
Sent: Tuesday, February 08, 2000 12:04 PM
Subject: Re: XSLT API Proposal (Draft 2)


| 
| "Steve Muench" <smuench@us.oracle.com> wrote:
| > Or maybe even better:
| >
| >    (*) Construct a Stylesheet, given "style.xsl" as input
| >
| >    (*) For each "run" of this stylesheet,
| >        => Construct a XSLTProcessor(Stylesheet) and
| >        => Call process(Source,Params,Result)
| 
| OK, if I rename Transform to Stylesheet (with reservations), and TContext
| to XSLTProcessor (probably a good idea, though if feels like "Processor" is
| something that can be used over and over), and take the example I did for
| Tangi, we get:
| 
| file://====================
| StylesheetFactory sfactory = XSLTFactory.newStylesheetFactory(...);
| Params params = new Params();  // Bag of params..
| params.set("foo", "http://foo.com", "hello");
| 
| Stylesheet stylesheet1 = sfactory .createStylesheet(new InputSource
| ("t1.xsl");
| XSLTProcessor processor1 = stylesheet1.getProcessor();
| 
| Stylesheet stylesheet2= sfactory.createStylesheet(new InputSource("t2.xsl"
| );
| XSLTProcessor processor2 = stylesheet2.getProcessor();
| 
| Stylesheet  stylesheet3 = sfactory.createStylesheet(new InputSource
| ("t3.xsl");
| XSLTProcessor processor3= stylesheet3 .getProcessor();
| 
| processor3.setResultTarget(new Result(System.out), oprop));
| processor2.setResultTarget(new Result(processor3), oprop));
| processor1.process(new InputSource("foo.xml"), params, new Result(
| processor2), null);
| file://====================
| 
| (You had a "new" on the XSLTProcessor, but I think it better to get if from
| the stylesheet in order to reduce the number of concrete constructors).
| 
| How does this look to people?  I rather like it...
| 
| -scott
| 
| 
| 
| 
| 
| 


Mime
View raw message