Subject: Re: [xsl] Correct way to test for no match From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 05 Oct 2009 12:52:50 -0400 |
I've used this approach myself to help determine when a new element has been added or someone starts using an element I've not seen used.
In this case I was in a when clause and I was trying to capture various combinations of markup errors.
<xsl:when test="ancestor::ipb/figure/subfig/graphic[@boardno=$sht_num]/@boardno">
So I was trying to understand what value this particular test would return so I could trap it.
In this case it was originally used like this and the function was indicating an empty or null value was being returned, so I was trying to match on that empty value.
unparsed-entity-uri(ancestor::ipb/figure/subfig/graphic[@boardno=$sht_num]/@boardno)
In this case I probably should have rearranged the when and otherwise tests and matched the good value and let the otherwise handled everything else. ultimately I also realized there was no value in doing this elaborate matching as the result is the same as the $sht_num.
1. What is unparsed-entity-uri($sht_num)? 2. Is $sht_num referred to elsewhere in the document?
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx 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 ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Correct way to test for n, Dan Vint | Thread | Re: [xsl] Correct way to test for n, Dan Vint |
Re: [xsl] temporarily enable a char, G. Ken Holman | Date | [xsl] Fwd: Is this a Saxon Bug ?, Frédéric Schwebel |
Month |