ned786 wrote:
>> > <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.
>
> Here's what this achieves. This XPath finds all the writable <item>
> elements for me, because I can identify them when the iname attribute
> does NOT start with one of the read-only strings (hr, usr, ulr, etc.).
>
> If you are questioning the syntax of saying "@iname !=
> starts-with(@iname,...)" instead of just "!= starts-with(@iname,...)",
> I did it that way because it seemed I had to or it didn't work. When I
> remove the "@iname !=", I get the error "Unexpected token != in
> expression" and it stops the transform. (I'm using Saxon at the command
> line.)
It's the = sign I'm questioning. What about !starts-with or
not(starts-with(...))
I am reminded of the programming language built into the P-Stat stats
package (PPL) which contained the amazingly useful syntax
if any(varname,varname,varname,...) among (value,value,value,...)
///Peter