1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ASV
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Convert all Element tags to uppercase and all attributres to lowercase
- before sending to Validation transform.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <!-- variables used for conversion to and from lowercase to uppercase characters -->
- <xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
- <xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
-
- <!-- match on entire HTML email body -->
- <xsl:template match="/" priority="1">
- <xsl:apply-templates/>
- </xsl:template>
- <!-- match elements and convert all to uppercase -->
- <xsl:template match="*">
- <xsl:variable name="ucElement">
- <xsl:value-of select="translate(local-name(),$lcletters,$ucletters)"/>
- </xsl:variable>
- <xsl:element name="{$ucElement}">
- <xsl:apply-templates select="@*"/> <!-- apply templates to attibutes -->
- <xsl:apply-templates/> <!-- apply templates to children -->
- </xsl:element>
- </xsl:template>
- <!-- match attributes and convert all to lowercase -->
- <xsl:template match="@*">
- <xsl:variable name="lcAttribute">
- <xsl:value-of select="translate(local-name(),$ucletters,$lcletters)"/>
- </xsl:variable>
- <xsl:attribute name="{$lcAttribute}">
- <xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:template>
- </xsl:stylesheet>
|