Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: another XSLT problem

From: Peter Flynn <peter.nosp@-.--------.-->
To: NULL
Date: 9/3/2005 12:46:00 PM
ned786 wrote:

> Your last suggestion also works, Peter, and you are my hero. Thanks!
> The problem is fixed and it saves me a tedious maintenance chore.

My pleasure...

> If you're interested, I had to add in yet another check to make it all
> work, and the final gnarly XPath looks like this:
> 
> <xsl:variable name="wri"
> select="count(items/item[(not(@doc = 'no') and @iname !=
> starts-with(@iname,'dr')) and
>     (not(@doc = 'no') and @iname != starts-with(@iname,'hr')) and
>     (not(@doc = 'no') and @iname != starts-with(@iname,'usr')) and
>     (not(@doc = 'no') and @iname != starts-with(@iname,'szr')) and
>     (not(@doc = 'no') and @iname != starts-with(@iname,'ulr')) and
>     (not(@doc = 'no') and @iname != starts-with(@iname,'ipr')) and
>     (not(@doc = 'no') and @iname != starts-with(@iname,'br')) and
>     (not(@doc = 'no') and @iname != starts-with(@iname,'ucr'))])"/>

I'm not clear what this is trying to achieve. @iname is an attribute:
testing its inequality against a boolean like starts-with will probably
have unexpected effects, depending on whether the attribute is present
or not. If present, and starting with 'hr', then the first test should
always evaluate false. 

> Weirdly, "not(@doc = no)" worked when "@doc != 'no'" did not. But I'm
> happy.

I have the feeling I've seen this too...possibly not all processors are 
happy with negated boolean conditions involving attributes.

///Peter



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent