123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2014
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:out="dummy-uri">
- <!-- This logicsheet simply adds onmouseover and onmouseout attributes to all <a> tags.
- Include this one last for best results. ;-) -->
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
-
- <xsl:template match="img">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:choose>
- <xsl:when test="child::*[local-name() = 'attribute' and @name = 'alt'] and not(child::*[local-name() = 'attribute' and @name = 'title'])">
- <out:attribute name="title">
- <xsl:copy-of select="child::*[local-name() = 'attribute' and @name = 'alt']/*"/>
- </out:attribute>
- </xsl:when>
- <xsl:when test="@alt and not(@title)">
- <xsl:attribute name="title"><xsl:value-of select="@alt"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <!-- A11Y support, add empty alt to img tag with spaces -->
- <xsl:choose>
- <xsl:when test="(child::*[local-name() = 'attribute' and @name = 'src'] and contains(child::*[local-name() = 'attribute' and @name = 'src'] , '/space.gif')) and not(child::*[local-name() = 'attribute' and @name = 'alt'])">
- <xsl:attribute name="alt"></xsl:attribute>
- </xsl:when>
- <xsl:when test="(@src and contains(@src,'/space.gif')) and not(@alt)">
- <xsl:attribute name="alt"></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- <!-- A11Y support, table columns that contain the defaultName of an object should be read in the content locale -->
- <xsl:template match="td[ancestor::table[@class='cctable'] and not(@lang) and descendant::*[local-name()='value-of' and (contains(@select,'cm:defaultName') or (contains(@select,'xtsext:formatDateFromUTC') and contains(@select, '$contentLocale')))]]">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="lang">{/root/user/param[@name='contentLocale']}</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- <!-- A11Y support, close markers should be buttons -->
- <xsl:template match="a[descendant::img[contains(@src, 'close.gif')]]">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:if test="not(@role)">
- <xsl:attribute name="role">button</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|