[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: I thought i knew how to do this -- followup

Subject: Re: I thought i knew how to do this -- followup
From: Markus Abt <abt@xxxxxxxx>
Date: Thu, 24 Feb 2011 01:05:23 +0100
Re:  I thought i knew how to do this -- followup
russurquhart1@xxxxxxxxxxx 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.