Re: another XSLT problem



Peter,

Wow, that fixes the problem, and it's elegant to boot! Thanks!

Here's the way I had to modify it for my actual XML files:

<xsl:variable name="ro"
select="count(items/item[starts-with(@iname,'dr') or
starts-with(@iname,'hr') or
starts-with(@iname,'usr') or
starts-with(@iname,'szr') or
starts-with(@iname,'ulr') or
starts-with(@iname,'ipr') or
starts-with(@iname,'br') or
starts-with(@iname,'ucr')])"/>
<xsl:choose>
<xsl:when test="$ro=0" >
<p>No read-only items.</p>
</xsl:when>
<xsl:otherwise>
<table>... etc.
</table>
</xsl:otherwise>
</xsl:choose>

As you can see, there are actually 8 different strings that indicate
"read-only" (dr, hr, etc.). Now I am trying to figure out how to "NOT"
that count() function above so I can do the same thing for the
remaining writable items: Print "None" if there are none, and put them
in a table if they exist. The following two have failed:

<xsl:variable name="ro"
select="count(items/item[not(starts-with(@iname,'dr')) or
not(starts-with(@iname,'hr')) or
... ])"/>

<xsl:variable name="ro"
select="count(items/item[@iname != starts-with(@iname,'dr') or
@iname != starts-with(@iname,'hr') or

... ])"/>


I'm trying to find the <item> elements that do not have the read-only
indication. If I can get this to work (find NOT read-only), it will
save work. Do you have any further enlightenment?

Regards,
Mark

.



Relevant Pages


Loading