I've got one stylesheet that creates multiple output text
files (via subclassing Saxon's Emitter). Some of those files
now need to be in a different output format, html. I noticed
that in the XSLT Prog. Ref. that it said the <xsl:output/>
element, "may appear any number of times in a stylesheet".
It's also a top-level element. I'm trying to determine how I
should be using the output element given my situation.
In XSLT 1.0, you can have more than one <xsl:output> element, but the
contents are effectively merged, you can only define one output format.
Always watch out when reading XSLT Prog Ref for the sections that say
"this is an XSLT 1.1 feature". XSLT 1.1 didn't make it to a
Recommendation and is not widely implemented. One feature that was new
in XSLT 1.1 was multiple output files.
Many products do actually support multiple output files, but the way
they control the formatting of each output file varies from one product
to another.
And in Saxon, it varies from one release to another, as I tried to track
the changes in the spec. Up to 6.5.2, <xsl:output> only controls the
format of the main output file, the format of other files in controlled
using <saxon:output> or <xsl:document>. In 7.x, you can have multiple
named output formats, and you refer to a named output format when
creating each result tree.
Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com
Questions:
1) do multiple outputs actually format the output differently
in different parts of the stylesheet, or is only one of them
used, e.g. the first or the last
2) if multiple outputs do format different parts of the
stylesheet differently, what are the rules of usage?
3) if i can't output multiple formats from the same
stylesheet, will using <xsl:output method="html"/> for the
text output mess anything up as long as there isn't any html
in the text? (i'm guessing no)
4) since all the output will take place within an
<xsl:document method="MyEmitterClass"/> does any of this
matter or does the document element somehow negate the output tag
thanks,
+jeff
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list