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

RE: xsl != not working?

Subject: RE: xsl != not working?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 21 Jun 2005 19:03:20 +0100
xsl not equal
  The basic test is:
> 
> //h2[1]/text() != text()
> 

Whenever you see A!=B, chances are it should be not(A=B)

The expression above is true if there is some h2 whose text is not equal to
the text of the current element. You probably want it to be true if there is
no h2 whose text equal to the text of the current element.

Also, using text() like this is usually wrong. An element can contain
comments and processing instructions as well as text nodes. Usually you want
to test the string value of the element, not the content of its text nodes.
Use

not(//h2[1] = .)

(But this might still be wrong, I haven't studied the problem you are trying
to solve).

Michael Kay
http://www.saxonica.com/

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.