Audun Røe wrote:
Hi,
I have a list of codes which I want translated into something
"understandable ". Is there a mechanism such as hashtables that could
handle this? (eg. PHP: array('F' => 'Foo', 'C' => 'Cat'))
It just seems as if a page worth of if-tests would be a fairly clumsy
solution to this (there are a lot of codes) problem.
Basically, I have an XML-document which looks like something like
this:
<Element T="F">.....</Element>
..and I want it transformed into the code's corresponding descriptive
name, like so (F ==> Foo):
<NewElement DN="Foo">..... </NewElement>
All sugestions appreciated!
--
Regards.
Audun
hi,
the better way, i think, is to define something like this snippet
stylesheet, and import it in your master stylesheet :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:date="htt p://www.foo.com/Processing/dates">
<date:month-names>
<date:month short="jan">jan uary</date:month>
<date:month short="feb">feb ruary</date:month>
<date:month short="mar">mar ch</date:month>
<date:month short="apr">apr il</date:month>
<date:month short="may">may </date:month>
<date:month short="jun">jun e</date:month>
<date:month short="jul">jul ly</date:month>
<date:month short="aug">aug ust</date:month>
<date:month short="sep">sep tember</date:month>
<date:month short="oct">oct ober</date:month>
<date:month short="nov">nov ember</date:month>
<date:month short="dec">dec ember</date:month>
</date:month-names>
<xsl:template name="date:mont h-name">
<!--returns the name of the month from its number-->
<xsl:param name="month" select="0"/>
<xsl:value-of
select="documen t('')/*/date:month-names/date:month[$month]"/>
</xsl:template>
</xsl:stylesheet>
--
Cordialement,
///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------