Transformation Result PreviousNext

XM_XSLT_TRANSFORMATION_RESULT is a wrapper for the various classes which might receive a result document from a transformation.

Creation Procedures

The creation procedure make_secondary_stream is only used for creating secondary streams, that is, those created by an xsl:result-document. Accordingly, users of the library will not use it directly.

The other creation procedures are for creating the primary result. Since the Eiffel programmer must use one of these when invoking transform, it is worth going into them in some detail.

make (a_stream: XM_OUTPUT; a_system_id:STRING)
This will be the one you normally want to use. You create a_stream using whichever creation procedure of XM_OUTPUT you find appropriate, and you couple a SYSTEM id with it.

This should be an absolute URI, especially if you use any xsl:result-documents with relative URIs for their href attribute, as they will be resolved realative to the one you supply.

If you use any xsl:result-documents with relative URIs for their href attribute, then make sure that your URI scheme is one that your output resolver can cope with.

make_receiver (a_receiver: XM_XPATH_RECEIVER)
With this creation procedure, you direct the output to an XPath library event stream. This would be an appropriate choice if you wanted to immediately run another transformation against the output from the first transformation.

I have added an extension attribute to xsl:output/xsl:result-document so that you will be able to specify a next transformation to run automatically. But even so, this option might be useful in some circumstances.

make_emitter (an_emitter: XM_XSLT_EMITTER)
This creation procedure enables you to direct output directly to an emitter (which is the XSLT library's serialization class). Normally the transformer will create an emitter for you, based on the attributes specified on xsl:output/xsl:result-document, so I don't think this creation procedure is needed, but you might decide otherwise.

I'm trying to think of a scenario in which this might be wanted. The only far-fetched idea I've been able to come up with, is if you have a chain of transformations, and you want to use the output attributes from the xsl:output in the first stylesheet (rather than the last, which is the normal situation). In which case you could create an emitter based on the initial xsl:output, and then pass it to this creation procedure. You would then pass the created transformation result to the last transform in the chain (and use make_receiver for the previous steps in the chain).

Copyright 2004, Colin Adams and others
Last Updated: Wednesday, October 20th, 2004