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

Re: Empty text area issue

Subject: Re: Empty text area issue
From: James Cummings <James.Cummings@xxxxxxxxxxxxxx>
Date: Fri, 23 Apr 2004 11:29:20 +0100 (BST)
empty text area
On Wed, 23 Apr 2003, Jonathan Kart wrote:

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

I'm sure others will have better ideas, but you could just put
an <xsl:text>  </xsl:text> in, couldn't you?

-James

---
Dr James Cummings, Oxford Text Archive, University of Oxford
James dot Cummings at ota dot ahds dot ac dot uk

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.