Re: what if use of up-to-date xslt processor not an option?

Subject: Re: what if use of up-to-date xslt processor not an option?
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 14 Jun 2000 10:57:08 -0600 (MDT)
> Mike- Sorry I missed this suggestion from you before. I had tons of new mail 
> I hadn't gone through. I tried it and it didn't quite work. But when I added 
> the brackets [ ], it worked:
> <xsl:when test=".[. $eq$ 'Transaction_Type']">

$eq$ is a Microsoft construct for testing string equality.
It is not needed in XSLT/XPath; '=' does the job.

> I posted another message asking what the brackets (with the dot inside it) 
> mean. Do you know?

Brackets indicate a predicate in XPath. Their purpose is close, but not
quite, the same in the old MSXML you're using. Apparently they are needed
in your case because MSXML is treating the value of a test="..." to be
like a select="...", where the value identifies a node-set and is not what
XPath defines as a boolean expression.

In XPath, predicates narrow down the node-set identified to their left (.,
which is the context node, in your example) by subjecting each node in the
set to a test, with the current node as the context node for purposes of
evaluating the boolean expression in the predicate. 

".[@foo='bar']" for example would mean the context node, as long as it
passes the test of having an attribute named 'foo' with a value of 'bar'.

In XPath, what is on the right side of a comparison operator affects how
what is on the left is interpreted, so changing the operator to do a
stringwise comparison is not necessary; the fact that 'bar' is a string
causes @foo to be interpreted as string(@foo).

Obviously things are different in old MSXML-land.

   - Mike
Mike J. Brown, software engineer at         My XML/XSL resources: in Denver, Colorado, USA 

 XSL-List info and archive:

Current Thread