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

Empty text area issue

Subject: Empty text area issue
From: Jonathan Kart <jkart@xxxxxxxxxxxx>
Date: Wed, 23 Apr 2003 03:25:49 -0700
xml text area
Hi all, 


Just a warning:  I'm new at this...

I have some xml data being converted into an editable format using html
elements.  

For text elements, I want to turn them into a <textarea> tag.  My xsl is
something like this:

<xsl:template match="some_node">
    <textarea>
        <xsl:value-of select="." />
    </textarea>
</xsl:template>


The problem occurs when the node in question is empty (which is perfectly
valid in my xml).  When this happens, the value-of returns nothing and the
processor truncates <textarea></textarea> to <textarea /> on the way out.
Most browsers choke on this odd looking html.
I know I could switch the output method to html, but these form elements
will nestle themselves inside another xml doc and must be well-formed xml.
If I use html as the output format, elements like
<input type="text" value="foo" /> are converted to the colloquial html
equivalent of
<input type="text" value="foo">
And are no longer well-formed.

Any ideas on how to keep these textareas from being truncated?

Thanks so much,
jk

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.