cocoon-dev mailing list archives

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

"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