Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: another XSLT problem

From: "ned786" <n786@---------.--->
To: NULL
Date: 9/6/2005 12:01:00 AM
Peter Flynn 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.)

I also tried putting the expression in parentheses like (!=
starts-with(@iname,...)), and the same error occurred. It only worked
when I put "@iname != starts-with(@iname,...)".

At this point I think I will just take the money and run. I can count
on there always being an iname attribute.

Thanks again,
Mark



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