473,791 Members | 3,275 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 6190


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="VBScr ipt" %>
<%
Option Explicit
Dim XmlDocument, XslDocument, Loaded
Set XmlDocument = Server.CreateOb ject("Msxml2.DO MDocument.4.0")
XmlDocument.asy nc = False
Loaded = XmlDocument.loa d(Server.MapPat h("test20040503 .xml"))
If Loaded Then
Set XslDocument = Server.CreateOb ject("Msxml2.DO MDocument.4.0")
XslDocument.asy nc = False
Loaded = XslDocument.loa d(Server.MapPat h("test20040503 Xsl.xml"))
If Loaded Then
XmlDocument.tra nsformNodeToObj ect 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:styleshe et 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>textar ea 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>textar ea test</title>
</head>
<body>
<form action=""><text area rows="5" cols="80">Kibol ogy 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.DOMDocu ment.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
16725
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, then a generic element's font will do OK, too. What's the correct way to do this, please (so that it will also work for IE 6)? The motivation for this is that I have some text on the screen and I want to insert a textarea element between the...
1
3577
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
12157
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 keyboard (keypress, keyup events) * Must work on pasted input from context menu * Must work on pasted input via CTRL+V and similar * Must work on pasted input via browsers menu>Edit>Paste * Must work in Mozilla + IE and coded via W3C standards
4
4263
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
5993
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 think my way around. I am using a <textarea> to display the code but some of my scripts have <textarea> tags in them and when the </textarea> tag is entered, it closes my <textarea> and the rest of the code ends up outside of the textarea.
6
31454
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 the HTML 4.01 specification I see this, too. What I'm wondering is - 'cols' & 'rows' determines the height & width of a textarea. So shouldn't that be something that is handled by CSS instead? What would be the practical consequence of leaving...
4
7808
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 find the text and select it using the function below, BUT I can't figure out how to have the textarea automatically scroll to the selection in Firefox. Any ideas or suggestions? function search(needle,haystack,start) { var element =...
3
4943
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 indicate that it does but I can't get it to work for the life of me. I've tired everything I can think of to try get notifications for the events: ondragenter ondragleave ondragover ondrop
3
5678
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 replace spaces with &nbsp;. The <br> part works well enough, but I keep getting "%20" instead of "&nbsp;" for the spaces. I understand that escape() changes " " to "%20", but I would think the ConvertSpaces function below would change the %20 to...
5
4784
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 test="@READONLY"> <xsl:attribute name="READONLY"><xsl:text>READONLY</xsl:text></ xsl:attribute> </xsl:if> <xsl:value-of select="."/> </TEXTAREA>
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9517
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9030
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.