I have an XML document which uses multiple @class values, like below:
<html>
<head>
<title>This is the title.</title>
</head>
<body>
<div class="sect1 rights">
<p>This is the first paragraph.</p>
</div>
</body>
</html>
However, my XSLT below does not work when both @class values are present. It will only work if <div class="rights">
.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*[@class='rights']">
<p>Rights have not cleared to show this material.</p>
</xsl:template>
I don't think this is a priority of templates problem (from the identity template) as I'm not getting a warning of that. Is there a way to select this content? I won't always know what other class values are assigned besides "rights" so I can't use *[@class='sect1 rights']
as sect1 will change throughout the document.