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

Re: copy-of select in textaereas

Subject: Re: copy-of select in textaereas
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 2 Dec 2002 17:36:50 GMT
xslt textarea
  this doesn't work at all:
  <textarea name="{@name}" onChange="{@onchange}" onclick="{@onclick}"
  rows="4" cols="10"><xsl:copy-of select="@value"/></textarea>

well the xslt should work and copy the value attribute to make a value
attribute in the result, but that isn't what you want.

  this works fine without carriage returns:
  <textarea name="{@name}" onChange="{@onchange}" onclick="{@onclick}"
  rows="4" cols="10"><xsl:value-of select="@value"/></textarea>

It is not XSLT that is losing the lines it is the XML parser.
XML specifies that
<a x="a
b
c">
is the same input as 
<a x="a b c">
so _every_ XML application, including XSLT will see spaces not line ends
in an attribute value.

If you must use an attribute in your source and line ends matter you
have to do
<a x="a&#10;b&#10;c">
which is the XML encoding of an attribute with value
"a
b
c"

Or change your input format so the value is stored in an element not in
an attribute.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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.