[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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)
xslt if test eq
> 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:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.