Subject: Re: [xsl] Finding and processing index terms From: Dan Vint <dvint@xxxxxxxxx> Date: Wed, 15 Feb 2006 11:12:43 -0800 |
To see the difference, consider <a> <x a="n"/> <x/> </a>
<?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(*[@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
a: 1 b: 1 c: 1
Specializing in Panoramic Images of California and the West http://www.dvint.com
When H.H. Bennett was asked why he preferred to be out shooting landscapes rather than spending time in his portrait studio:
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Finding and processing in, David Carlisle | Thread | Re: [xsl] Finding and processing in, David Carlisle |
RE: [xsl] Retrieving data from two , cknell | Date | RE: RE: [xsl] Finding and processin, Dan Vint |
Month |