C4CodeE4Exe
C4CodeE4Exe

Reputation: 3990

XSLT 1.0 dynamic imports of different xsl into master xsl

I am using XSL 1.0 version. I have a master.xsl which takes xml as input and creates out in html.It will generate html file with labels and values.

Now I want to generate html with labels in different languages.Suppose if the language code in input is "EN", the labels should be English else some other language.

I tried using

<xsl:importhref="en.xsl" 
 use-when="system-property('xsl:languageCode')='EN'"/>

But it is not working in XSL 1.0.

Is there any other way to do this in XSLT or is there better non-xslt solution to this.

Upvotes: 0

Views: 147

Answers (1)

Michael Kay
Michael Kay

Reputation: 163418

The use-when attribute requires XSLT 2.0.

The answer to this is to invert your import hierarchy. Instead of importing special-purpose code (en.xsl) into a module containing general-purpose code (master.xsl), do it the other way around (have en.xsl import master.xsl). Then make the special-purpose module en.xsl your stylesheet entry point.

Upvotes: 1

Related Questions