Hi Morten,
My two cents:
TransformerHandlerImpl for Xalan-J (regular)
simply sets the ContentHandler for the result
in setResult, and performs the transformation
when endDocument is called. In the absence of
a clear specification, I suggest consistency
with that behavior. And I would say it should
be an error if endDocument is called when the
result target is unspecified (unless there is
some other meaningful behavior to specify ...
I can't think of any).
Cheers,
- Gulli
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 2. agust 2001 14:08
To: xalan dev
Subject: TransformHandler and sequence of events
A general questions on using a TransformHandler:
I am implementing the TransformHandler interface for XSLTC,
and I cannot figure out 100% how this interface is inteded
used. The interface includes SAX2's ContentHandler, it has
a method called setResult(Result result) which can be used
to set the Result object for the transformation, and it has
a getTransformer() method that returns a reference to the
Transformer that will perform the actual transformation.
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. 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.
So when should the transformation be started? When the
TransformHandler's endDocument() is called? But what if the
setResult() method was not called before that? Should we
then wait until setResult() is called, or should we still
run the transformation and dump the output to System.out ?
I have choosen to run the transformation in whatever method
is called _last_ of endDocument() and setResult(), but there
is no particular reason for that other than that I have all
the info I need at this point.
Morten