Re: [xsl] Finding and processing index terms

Subject: Re: [xsl] Finding and processing index terms
From: Dan Vint <dvint@xxxxxxxxx>
Date: Wed, 15 Feb 2006 11:12:43 -0800
I'm not following this, below

At 09:45 AM 2/15/2006, David Carlisle wrote:
To see the difference, consider
<x a="n"/>

But this is really the design I have:

<?xml version="1.0"?>
<!ELEMENT a  (x*) >

          a  CDATA   "y" >

<x a="n"/>

Then ask for all the children of x that don't have an attribute that is 'y'
(or the different question, have an a attribute that is not 'y')

<xsl:stylesheet version="1.0"

<xsl:template match="a">
a: <xsl:value-of select="count(*[@a!='y'])"/>
b: <xsl:value-of select="count(*[not(@a='y')])"/>
c: <xsl:value-of select="count(*[string(@a)!='y'])"/>


$ saxon neq.xml neq.xsl
<?xml version="1.0" encoding="utf-8"?>
a: 1
b: 2
c: 2

So when I run this in Stylus or saxon I get the results that I expect:

a: 1
b: 1
c: 1

I agree this is an issue if the DTD did not exist, but it does and the default values are there just like if they were typed in the data stream.

SO I don't see this as so much a warning against != as it is being aware of the environment your processing in - unless I missed something.
Danny Vint

Specializing in Panoramic Images of California and the West

voice: 510-522-4703

When H.H. Bennett was asked why he preferred to be out
shooting landscapes rather than spending time in his portrait studio:

"It is easier to pose nature and less trouble to please."

Current Thread