Re: [xsl] Converting a string to Uppercase or Lowercase without using translate() ?

Subject: Re: [xsl] Converting a string to Uppercase or Lowercase without using translate() ?
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 27 Nov 2007 16:22:46 +0000
On 27/11/2007, G. Ken Holman <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote:
> At 2007-11-27 15:14 +0000, Andrew Welch wrote:
> >or perhaps "manage" your namespaces:
> >
> ><!ENTITY xslt-ns 'http://www.w3.org/1999/XSL/Transform'>
> >
> ><xsl:stylesheet xmlns="&xslt-ns;" version="2.0">
> >
> >I know I'm being silly now...
>
> Not really ... I've used entities for namespace URI strings when a
> vocabulary changes its URI but the transformation of the elements is
> unchanged:  keep a master copy of the stylesheet in a source code
> control system, deploy copies to two directories, use parameter
> entities to define general entities with the namespace URI string,
> and then each stylesheet supports a different version of the URI string.

Or just transform the original once per namespace update (or just do
it manually - you'd have to hand edit each copy to insert the entity
refs anyway).

It probably wasn't the worst example I could've come up with.

Maybe we should have a go at obfuscating XSLT through over zealous use
of entities... like turning the identity template into the &ident;
entity ref:

<!DOCTYPE xsl:stylesheet [
<!ENTITY xslt-ns 'http://www.w3.org/1999/XSL/Transform'>
<!ENTITY opt '<xsl:output indent="yes"/>'>
<!ENTITY ident '<xsl:template
match="@*|node()"><xsl:copy><xsl:apply-templates
select="@*|node()"/></xsl:copy></xsl:template>'>
]>
<xsl:stylesheet xmlns:xsl="&xslt-ns;"
    version="2.0">
    &opt;
    &ident;
</xsl:stylesheet>

:)

Current Thread