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

Re: Correct way to test for no match

Subject: Re: Correct way to test for no match
From: Dan Vint <dvint@xxxxxxxxx>
Date: Fri, 02 Oct 2009 18:58:21 -0400
Re:  Correct way to test for no match
At 05:43 PM 10/1/2009, you wrote:
I think you probably want "ancestor::ipb/figure/subfig/graphic/@boardno=$sht_num" as a positive test -- this will be true if there is a match (there exists a graphic/@boardno in that place whose value is $sht_num).

I inherited this stylesheet. After working on this some last night and today, and looking at this answer, I'm not sure why there is this convoluted code. If there is a match on the $sht_num it means I have the value. So I think I can eliminate this test completely and just use the value.


This path was actually used to find a file path with unparsed_entity_uri, this was failing because it was getting an empty string. So I was trying to catch the error before it got to this function.


Your second attempt can be true only if $sht_num is "", and never otherwise. (It will also fail if no graphic elements are found on that path.)


So that last statement is what I was trying to test for. What is the result of a miss match? Is there a way to test for the results of a match that don't return a result? My two attempts were unable to trap the result of the test and do anything with it. Is there something else I should have tried?


--------------------------------------------------------------------------- Danny Vint

Panoramic Photography
http://www.dvint.com

voice: 502-749-6179

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.