This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Translating element names
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Translating element names
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Tue, 16 Jan 2001 22:43:35 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> I am having trouble writing an XSLT to do a simple
> transformation task. I have lots of XML documents
> that have there element tags as CAPITAL letters. I
> need to write a XSLT to transform these XML documents
> to contain all lowercase elements.
You need something like
<xsl:template match="*">
<xsl:element name="{translate(name(), 'ABCDEF...', 'abcdef...')}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
Possibly a bit more complex if using namespaces.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list