I'm not following this, below
At 09:45 AM 2/15/2006, David Carlisle wrote:
To see the difference, consider
<a>
<x a="n"/>
<x/>
</a>
But this is really the design I have:
<?xml version="1.0"?>
<!DOCTYPE a [
<!ELEMENT a (x*) >
<!ELEMENT x EMPTY >
<!ATTLIST x
a CDATA "y" >
]>
<a>
<x a="n"/>
<x/>
</a>
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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="a">
a: <xsl:value-of select="count(*[(_at_)a!='y'])"/>
b: <xsl:value-of select="count(*[not(@a='y')])"/>
c: <xsl:value-of select="count(*[string(@a)!='y'])"/>
</xsl:template>
</xsl:stylesheet>
$ 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
http://www.dvint.com
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."
http://www.portalwisconsin.org/bennett_feature.cfm
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--