RE: [xsl] wierd textarea behaviour with xsl

Subject: RE: [xsl] wierd textarea behaviour with xsl
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 12 Nov 2002 11:15:04 -0500

At 10:18 AM 11/12/2002, you wrote:
So to try and force a value into the box I used an xsl choose.

<textarea rows="5" cols="40" name="comment" class="textbox">
                <xsl:when test="(./currentStatus/comment)">
                                <xsl:when test="./currentStatus/comment !=
                                        No comments.

This has fixed it. Man, what a verbose way of having to populate a comment

Tom SW suggested a way to mitigate how verbose it is.

Another way -- perhaps not as neat conceptually, but not requiring you to have a fallback node, is simply not to use the xsl:choose. Since, as you've noted, you get no output if there is no ./currentStatus/comment, your logic is equivalent to:

<textarea rows="5" cols="40" name="comment" class="textbox">
  <xsl:value-of select="currentStatus/comment"/>
  <xsl:if test="not(currentStatus/comment)">No comments.</xsl:if>

Not so bad, eh?

Notice I've trimmed your './currentStatus/comment' to 'currentStatus/comment' since they mean the same thing.

Others have addressed your getting the unwanted XML empty-element syntax. That's the real solution.


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. 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 ======================================================================

XSL-List info and archive:

Current Thread