This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Localising Submit/Clear buttons in html
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] Localising Submit/Clear buttons in html
- From: Ian_blizard at hp dot com (Ian Blizard)
- Date: Mon, 12 Nov 2001 16:47:51 +0000
- Reply-to: xsl-list at lists dot mulberrytech dot com
Woah Nelly!
I've got it working:
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="doc-file" />
<xsl:param name="currentLocale" />
<xsl:template match="text()|@*">
<xsl:value-of select="." />
</xsl:template>
<xsl:template match="*|node()" priority="1">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="input[@nlsid]" priority="50">
<xsl:copy>
<xsl:for-each select="@*">
<xsl:if test="name()!='nlsid'">
<xsl:copy-of select="." />
</xsl:if>
</xsl:for-each>
<xsl:variable name="myKey" select="@nlsid" />
<xsl:choose>
<xsl:when
test="document($doc-file)/locale/*[name()=$myKey]">
<xsl:attribute name="value">
<xsl:value-of
select="document($doc-file)/locale/*[name()=$myKey]/*[name()=$currentLoc
ale]" />
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:copy>
</xsl:template>
<xsl:template match="*[@nlsid]" priority="5">
<xsl:copy>
<xsl:for-each select="@*">
<xsl:if test="name()!='nlsid'">
<xsl:copy-of select="." />
</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="./*" />
<xsl:variable name="myKey" select="@nlsid" />
<xsl:choose>
<xsl:when
test="document($doc-file)/locale/*[name()=$myKey]">
<xsl:value-of
select="document($doc-file)/locale/*[name()=$myKey]/*[name()=$currentLoc
ale]" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Does the trick.
-Buzz.
-----Original Message-----
From: davidc [mailto:davidc@nag.co.uk]
Sent: 12 November 2001 16:33
To: xsl-list
Subject: Re: [xsl] Localising Submit/Clear buttons in html
> That won't work david. You want something more like
not that I've tested either, but you don't need to special case
name() != 'value'
you can copy it the first time and just over-write it aith the
xsl:attribute if necessary. (which is why I just used xsl:if where
the original version, for elements had an xsl;choose/xsl:otherwise.
But maybe there was something else wrong?
(once you delete the spurious <xsl:choose> that I only half replaced by
xsl:if)
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list