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 23:57:41 GMT
Scott,

One question on Result() and setResultTarget()

Several XSLT processors support the ability to 
write to multiple resultTargets via built-in
extension elements.

the setResultTarget() obviously handles the
default case from the spec for a single result,
but would a processor make use of more Result() 's
under the covers to write to multiple outputs?

__________________________________________________________
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: <xalan-dev@xml.apache.org>
Cc: <cocoon-dev@xml.apache.org>
Sent: Tuesday, February 08, 2000 3:42 PM
Subject: Re: XSLT API Proposal (Draft 2)


| 
| "Steve Muench" <smuench@us.oracle.com> wrote:
| >| params.set("foo", "http://foo.com, "hello");
| >
| > What's the third argument here? Name, Value, ??
| 
| Name, namespace, and value.  Remember that param names are those pesky
| qnames.  We can have a signature that just takes in a simple name and a
| value.  I don't think use of prefixes is an option.
| 
| >| 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.
| 
| Yep.
| 
| >| 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?
| 
| I think XSLTProcessor derives from DocumentHandler.  So this is just
| Result(DocumentHandler handler).
| 
| >You have used newTransformFactory() and createTransform()
| >Should we standardize on either "newXX" or "createXXX" ?
| 
| Yep.  newXX is probably better just because it's shorter, and matches the
| Java "new" keyword.
| 
| OK, so that would put us at:
| 
|   public static void main( String argv[] )
|   {
|     TransformFactory sfactory = XSLTFactory.newTransformFactory(...);
|     Params params = new Params();  // Bag of params..
|     params.set("foo", "http://foo.com", "hello");
| 
|     Transform transform1 = sfactory .newTransform(new InputSource
| ("t1.xsl"));
|     XSLTProcessor processor1 = transform1.newProcessor();
| 
|     Transform transform2= sfactory.newTransform(new InputSource("t2.xsl"));
|     XSLTProcessor processor2 = transform2.newProcessor();
| 
|     Transform  transform3 = sfactory.newTransform(new InputSource
| ("t3.xsl"));
|     XSLTProcessor processor3= transform3 .newProcessor();
| 
|     processor3.setResultTarget(new Result(System.out));
|     processor2.setResultTarget(new Result(processor3));
|     processor1.process(new InputSource("foo.xml"), params, new
| Result(processor2));
|   }
| 
| How's that look?
| 
| -scott
| 
| 
| 
| 
| 
| 


Mime
View raw message