cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Boag/CAM/Lotus" <>
Subject Re: XSLT API Proposal (Draft 2)
Date Tue, 08 Feb 2000 23:42:23 GMT

"Steve Muench" <> wrote:
>| params.set("foo", "", "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
>| 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),
>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", "", "hello");

    Transform transform1 = sfactory .newTransform(new InputSource
    XSLTProcessor processor1 = transform1.newProcessor();

    Transform transform2= sfactory.newTransform(new InputSource("t2.xsl"));
    XSLTProcessor processor2 = transform2.newProcessor();

    Transform  transform3 = sfactory.newTransform(new InputSource
    XSLTProcessor processor3= transform3 .newProcessor();

    processor3.setResultTarget(new Result(System.out));
    processor2.setResultTarget(new Result(processor3));
    processor1.process(new InputSource("foo.xml"), params, new

How's that look?


View raw message