Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2005, 06:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default Weird whitespace appears in TEXTAREA, why?

Through an XSLT document I have added an HTML textarea to a form, which works, beside the fact that some whitespace charaters appear after the page is generated. Why can this be?

The textarea is put in a series of nested tables, and what I have found out through experiments is that for every new table I put it in 6 new whitespaces are added, odd right? Furthermore, I found that if I put a single character just outside the textarea (also nested within tables), then the whitespace is not there. Why? Is it some kind of bug? Solution?

I cannot recreate the error in a simple HTML document.

Thanks, Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old November 10th, 2005, 06:53 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As an ugly work-around to the problem I found is this...
Code:
<textarea id="message" name="message" type="text" runat="server"></textarea>
<script language="javascript">    
    document.getElementById("message").innerText = "";
</script>
Well, it is not pretty, but it works. Still very interested in the reason and perhaps the correct solution.

Jacob.
 
Old November 10th, 2005, 07:27 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Unwanted whitespace in your result document can come from three sources:

(a) there was whitespace in the source document which you copied to the result

(b) there was whitespace in the stylesheet which you copied to the result

(c) the whitespace was added by the serializer when indenting the result document if you specified indent=yes (which is the default for HTML)

Without more information it's impossible to tell which of these was the cause in your case.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 10th, 2005, 08:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks again, Michael, and naturally you are right.

The 3rd whitespace source you mentioned (c) fit quite well on the description of the problem in the first place; i.e. as the tables get more and more nested, more whitespace is added.

I swiched the indent to no and there was no more whitespace in un-wanted places. Is it a bug?

Thanks, Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Include a column if it appears more than once... SpyderSL Access 20 June 3rd, 2008 10:06 AM
whitespace in label Twinklestar ASP.NET 1.0 and 1.1 Basics 4 July 28th, 2004 07:37 AM
display vbCrLf's from textarea to textarea mat41 Classic ASP Basics 8 June 10th, 2004 12:19 AM
"Ghost Form Appears" dbkester Access 2 October 3rd, 2003 09:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.