Re: [xsl] conditionally outputting with different encodings

Subject: Re: [xsl] conditionally outputting with different encodings
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 19 Oct 2006 20:23:30 +0100
In xslt2 you have more flexibility but in 1.0 you may need to use
multiple stylesheets. 

  Right now I'm using numerous stylesheets, with only
  one element changed, <xsl:output encoding="xxx" ..../>
  which really seems like quite a kludge, and is a
  hassle to keep them synced. The style sheets all use
  the same encoding, Shift_JIS.

The stylesheets don't need to be copies that you need to keep in sync,
they just need to be 2 line stylesheets that 
a) set the output encoding and b) xsl:import the stylesheet that does
the work.

Alternatively to using these wrapper stylesheets many xslt 1 engines will
allow the encoding to be specified in the API that's calling the
transform, effecively overriding the xsl:output attributes.
details depend on the xsl engine and api of course.


Current Thread