RE: [xsl] $any$ in MSXML

Subject: RE: [xsl] $any$ in MSXML
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 3 Aug 2004 20:31:56 +0100
I don't know the exact semantics of the WD-xsl dialect (I suspect it was
never very well specified), but it's essentially doing an existential
quantification, which is what the XPath operators "=", "!=" etc do by
default. So it's probably safe to drop it.

I would guess you can further simplify 

    metadata/spref[.//* != ''] 

to

    metadata/spref[. != '']

since if an element has a descendant whose string-value is non-empty, the
element itself will have a string-value that is non-empty. But the converse
condition isn't true: if the element is <spref>zzz</spref> then the first
condition will be false and the second will be true.

Watch out for whitespace: WD-xsl strips whitespace-only text nodes by
default, whereas XSLT doesn't. 

Michael Kay 

> -----Original Message-----
> From: John C Cartwright [mailto:John.C.Cartwright@xxxxxxxx] 
> Sent: 03 August 2004 19:31
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] $any$ in MSXML
> 
> Hello All,
> 
> I'm converting an old MSXML stylesheet and am looking for 
> suggestions on 
> replacing constructs like the following:
> 
>   <xsl:if test="metadata/spref[$any$ .//* != '']">
> 
> So far, I've just been removing the "$any$" and although it seems to 
> work OK, I'm a little uncomfortable with that approach since I can't 
> seem to find documentation on exactly what that is supposed 
> to represent.
> 
> Can anyone explain this, suggest a better replacement, or point me to 
> documentation that does?
> 
> Thanks!
> 
> -- john
> 
> =====================================================
> John Cartwright
> Associate Scientist
> Geospatial Data Services Group
> CIRES, National Geophysical Data Center/NOAA
> (303) 497-6284
> John.C.Cartwright@xxxxxxxx
> =====================================================

Current Thread