Morten Jorgensen <[EMAIL PROTECTED]> wrote:
> The getTransformer() method is there only so that the user
> can pass parameters and set output properties to the
> Transformer. From what I understand the user should never
> call the transform() method on this object.

Yes, this is kind of ugly.

> This does not
> make sense as the input to the transformation is passed to
> the TransformHandler as SAX events and not as a Source obj.

I don't understand this statement.

> So when should the transformation be started? When the
> TransformHandler's endDocument() is called?

The transformer can begin the transformation as soon as startDocument has
been called (provided it can do incremental transformation).  Or you can
wait until endDocument.

> But what if the
> setResult() method was not called before that?

It must be called before the startDocument.  If the java doc doesn't state
this, it should.

> Should we
> then wait until setResult() is called, or should we still
> run the transformation and dump the output to System.out ?

Since the spec doesn't say, I guess it's your choice to System.out or throw
an error. I think Xalan-interpretive will probably throw an NPE, though,
frankly, I'm not sure... something to try.

> I have choosen to run the transformation in whatever method
> is called _last_ of endDocument() and setResult()

I think the best thing to do is for both of us to throw an exception if
setResult hasn't been called at the point of startDocument.  It's better to
be rigid about this.

-scott





Reply via email to