russurquhart1(_at_)verizon(_dot_)net wrote:
The code is as follows:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="*[@filter]">
<xsl:choose>
<!-- <xsl:when test="contains(@filter, 'filter10') or
contains(@filter, 'filter1')">-->
<xsl:when test="contains(@filter, 'filter10') or (./@filter='filter1'
and not(contains(@filter, 'filter17')))">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:when>
<xsl:otherwise />
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
(A little update. A filter value of 'filter1' will ONLY appear by itself and
NOT in a string with other values, as i reported yesterday.) With that said i
felt sure that i could THEN test for the 'filter1' value by using a
@filter='filter1' > type of check. (Thinking the '=' would be a complete,
exact type of comparison as opposed to a 'contains' function call.
When i ran the xsl, i did have some @filter='filter17' values, BUT these got
matched by my @filter='filter1' check.
No. There must be another reason for your result.
You can replace
./@filter='filter1' and not(contains(@filter, 'filter17'))
by:
@filter='filter1'
(I know because i took that conditional out and no 'filter17' values were
output.) Is this correct?
To summarize. I thought:
./@filter='filter1' would NOT match @filter='filter17'
correct
but fully expected
contains(. , 'filter1') to match @filter='filter17'.
correct (if . is @filter)
Regards,
Markus
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--