cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Boag/CAM/Lotus" <Scott_B...@lotus.com>
Subject Re: XSL/xalan and Localization
Date Sat, 05 Feb 2000 17:57:53 GMT

Mike Engelhart <mengelhart@earthtrip.com> wrote:
> My question is, doesn't this kind of mix style/content and data?   I
mean,
> <SUBMIT_BUTTON> doesn't do anything other than allow me to use dynamic
> strings inside my XSL

I agree.  There's no way you should have the text for the submit button
inside the data.

> I was thinking it would
> make more sense (to me at least) to allow XSL to have either a way of
> getting at localized resources during the transformation - something like
> <?language-resource type="http://www.earthtrip.com/resources/lang.dtd"?>
> <xsl:i18n>
>     <xsl:value-of select="SUBMIT_BUTTON"/>
>  <xsl:i18n>

In general XSLT needs enhancement in this area, in my opinion (you ought to
be able to use xsl:include to help you with this).  There may be ways you
could do what you need to do without altering the processor by making it
process a processing-instruction.  Ideas:

1) There are ways you can set up name-value dictionaries via xsl:key for
external XML files.  So you could set up an XML file with your string
properties, index them via the document() function and xsl:key, then use
the system-property() function (or a stylesheet parameter) to lookup which
string to use.  I could probably set up an example of doing this, if you
want to pursue it, though I'm pretty busy this week.

2) You could use Xalan's XSLT extensions to do exactly what you are doing
in XSP.  This is not as preferable as option #1, because it's vendor
specific (since the language bindings for XSLT extensions are not yet
standardized).  The advantage would be that you could keep your strings in
the Java resource format (actually, I'm not so sure this is an advantage).

-scott






Mime
View raw message