Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Correct way to test for no match

From: Dan Vint <dvint@-----.--->
To: xsl-list@-----.------------.---
Date: 10/4/2009 1:10:00 PM
One other thought on this. The reason it is important to know if I 
don't have a match is that there should always be a match and it is 
important to report this state. I suppose I could rearrange the code. 
I was using the otherwise as the default good condition while I 
wanted all the tests to be in the where clauses.

..dan

At 06:58 PM 10/2/2009, you wrote:
>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
>
>
>
>--~------------------------------------------------------------------
>XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
>or e-mail: <mailto:xsl-list-unsubscribe@l...>
>--~--
>

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

Panoramic Photography
http://www.dvint.com

voice: 502-749-6179
     


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent