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

RE: wierd textarea behaviour with xsl

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

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:choose>
                <xsl:when test="(./currentStatus/comment)">
                        <xsl:choose>
                                <xsl:when test="./currentStatus/comment !=
''">
                                        <xsl:value-of
select="./currentStatus/comment"/>
                                </xsl:when>
                                <xsl:otherwise>
                                        No comments.
                                </xsl:otherwise>
                        </xsl:choose>
                </xsl:when>
        </xsl:choose>
</textarea>

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

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>
</textarea>

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.

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 ======================================================================


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



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.