[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [dssslist] FW: XPATH 'OR' Operator Syntax Question


You have written DSSSList, not XSL-List. XSL-List will not hear your question.

At 10:04 AM 5/14/2009, Joran, Peter wrote:
Do you know how to use an 'OR' operator in XPATH? I've looked on-line
and I'm coming up empty.
In the expression below I want to count records with a Status = Here OR
Pending OR Accepted.

All thoughts very welcome!
Many Thanks

count(/dsQueryResponse/Rows/Row[normalize-space(@Status_) = 'Here' and
normalize-space(@Classification_) = $fieldvalue]/@Source)

Your example uses the XPath 'and' operator. The 'or' operator is precisely analogous; it performs a Boolean OR.

Depending on whether you are using XPath 1.0 or 2.0, along with details of your requirements, further improvements can be made. For example, where XPath 1.0 has

/path/to/node='a' or /path/to/node='b'

in XPath 2.0 you can say


To pursue this further, you might subscribe to XSL-List as described at http://www.mulberrytech.com/xsl/xsl-list/.

Good luck,

Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML