[xsl] Re: <xsl:choose>...now getting both the <xsl:choose> result AND the < xsl:otherwise> result

Subject: [xsl] Re: <xsl:choose>...now getting both the <xsl:choose> result AND the < xsl:otherwise> result
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Mon, 8 Sep 2003 21:12:08 +0200
"Kathy Burke" <Kathy_Burke@xxxxxxxxx> wrote in message
> Hi again. After continued searching, came across some postings and revised
> my xsl as follows:
> (The xml is simply either <measure name="firstpass">20 mm</measure> or
> <measure name="firstpass/>.)
> <xsl:template match="measure">
>    <xsl:choose>
>       <xsl:when test="not(normalize-space(.))">
>           <input type="text" name="{@name}" value="{.}"/>
>       </xsl:when>
>       <xsl:otherwise>
>            Entered: <value-of select="."/>
>       </xsl:otherwise>
>    </xsl:choose>
> </xsl:template>
> However, if the text node has content, now I get BOTH the input textbox
> the test node value after that.
> If there is no text node for <measure>, I just get the text box as
> I also tried test="not(string(.))" with the same results. Cleary I'm still
> missing something?

Let me guess: does the default template rule produce this for you?


Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread