473,503 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TEXTAREA and XSL

I noticed when displaying the contents of a CDATA node inside a
TEXTAREA using
MSXML and XSL, I get an extra space before the data.

at first I thought I hadn't "tightened up" the XSL, but then even when
I did
this...

<textarea rows="24" cols="80"><xsl:value-of
select="/Root/Child/Data"/></textarea>

I still got a leading whitespace. During testing the data is only the
string "Unknown."

Is this common to others?

I noticed TEXTAREAs are a bit different when using XSL.

I also noticed the string value you pass to an XSL parameter using
..addparameter of the IXSLProcessor can't handle large strings of data
(it's about 3KB of data), to pass on and display inside the XSL.
Jul 20 '05 #1
3 6170


Gadrin77 wrote:
I noticed when displaying the contents of a CDATA node inside a
TEXTAREA using
MSXML and XSL, I get an extra space before the data.

at first I thought I hadn't "tightened up" the XSL, but then even when
I did
this...

<textarea rows="24" cols="80"><xsl:value-of
select="/Root/Child/Data"/></textarea>

I still got a leading whitespace. During testing the data is only the
string "Unknown."

Is this common to others?

I noticed TEXTAREAs are a bit different when using XSL.


You haven't told us which version of MSXML you use and how you transform.
When I try the following ASP page with MSXML 4

<%@ Language="VBScript" %>
<%
Option Explicit
Dim XmlDocument, XslDocument, Loaded
Set XmlDocument = Server.CreateObject("Msxml2.DOMDocument.4.0")
XmlDocument.async = False
Loaded = XmlDocument.load(Server.MapPath("test20040503.xml" ))
If Loaded Then
Set XslDocument = Server.CreateObject("Msxml2.DOMDocument.4.0")
XslDocument.async = False
Loaded = XslDocument.load(Server.MapPath("test20040503Xsl.x ml"))
If Loaded Then
XmlDocument.transformNodeToObject XslDocument, Response
Else
Response.Write "Error loading stylesheet.<br>" & VbCrLf
End If
Else
Response.Write "Error loading XML file.<br>" & VbCrLf
End If

Set XmlDocument = Nothing
Set XslDocument = Nothing

%>

to transform the following XML

<?xml version="1.0" encoding="UTF-8"?>
<root><![CDATA[Kibology for all.]]></root>

with the following stylesheet that sets the output method to html

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="UTF-8" />

<xsl:template match="/">
<html>
<head>
<title>textarea test</title>
</head>
<body>
<form action="">
<textarea rows="5" cols="80"><xsl:value-of select="root"
/></textarea>
</form>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

I do not get any leading spaces in the textarea, indeed the output of
the ASP page is the following HTML:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>textarea test</title>
</head>
<body>
<form action=""><textarea rows="5" cols="80">Kibology for
all.</textarea></form>
</body>
</html>

Maybe you are not using html as your output method??

Even if I change the ASP page to use MSXML 3 (Msxml2.DOMDocument.3.0) I
don't get any whitespace.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
> You haven't told us which version of MSXML you use and how you transform.
When I try the following ASP page with MSXML 4

MSXML 4 SP2 I'm not using ASP, but rather a client app using MSIE 6.


Maybe you are not using html as your output method??


no my output declaration does specifically say HTML, but the rest of the
page is fine.

normalize-space or something?

okay just tried normalize-space and it strips the CRLF from the data, so
forget that.

just tried it with the output="html" declaration and I got the same thing
as the original.

I guess I can take care of it on the data side, where I trim any leading
whitespace, but boy is this weird.
Jul 20 '05 #3


Gadrin77 wrote:
You haven't told us which version of MSXML you use and how you transform.
When I try the following ASP page with MSXML 4

MSXML 4 SP2 I'm not using ASP, but rather a client app using MSIE 6.


It is difficult to guess what could go wrong, maybe you can post some
code or a URL so that we can see what goes on and where the white space
comes from.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
16662
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
1
3543
by: Volt | last post by:
is there any way to select and mark part of text in textarea by regular expression? i need to select the first string in textarea whitch is like xxxxx,xxx where x is any character
5
12117
by: Jesper Rønn-Jensen | last post by:
I have a textarea that must be limited to 70 characters. No big deal -- at least so I thought. * Textarea must not exceed 70 characters * Exceeding content must be cut off * Must work on input by...
4
4224
by: TJS | last post by:
can the rows and columns of a textarea element with an id be changed on the fly ? if so is there an example ?
6
5962
by: wperry1 | last post by:
I am writing a small database utility to catalog all of my favorite ASM/JS/VBS... functions and scripts on an asp page. Everything is going smoothly except for one thing that I can't quite seem to...
6
31412
by: Tony | last post by:
The w3schools HTML tag reference for <textarea> http://www.w3schools.com/tags/tag_textarea.asp says that the attributes 'cols' and 'rows' are REQUIRED attributes for the textarea tag. Looking at...
4
7739
by: Keith Bentrup | last post by:
Hi all, I wrote a simple search function to find text in a textarea where not all the text is visible (ie. the text box displays 10 lines but there may be more than 1000 lines to search). I can...
3
4911
by: MikeK | last post by:
Ok, I've been noodling with this for several days now and I'm starting to go crazy. Does Apple's Safari browser support drag events on Textarea elements? The few specs and docs I've found seem to...
3
5621
by: FunkHouse9 | last post by:
I'm working on a form to collect data in a textarea which and am trying to keep returns and spaces. I have a couple of functions that I Frankensteined together to replace returns with <br> and to...
5
4756
by: a113n | last post by:
I have the following XSL code to handle textareas: <!-- Match TEXTAREA --> <xsl:template name="TEXTAREA" match="TEXTAREA"> <TEXTAREA ROWS="{@ROWS}" COLS="{@COLS}" NAME="{@NAME}"> <xsl:if...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.