473,471 Members | 4,648 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

add and remove whitespace

I have an asp.net application.

i export to excel, in exporting to excel i use an xslt to define the
columns and look.

on one of the fields i need the word 'qty' but i need it to look like
' qty' with 5 white spaces. i am able to do that in my xslt and
the export to Excel looks fine also.

but then i have another app i feed this excel sheet to, and in that
app (vbscript) i use trim(qtyField) but it doesn't remove the white
spaces out of the excel app.

if i do it manually without the xslt (place the white spaces in the
qty field), the vbscript app trims the white spaces just fine.

i don't know why??
anyone have any ideas? thx.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [<!ENTITY nbsp " ">]>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:template match="/">
<HTML>
<HEAD>
<STYLE>
.HDR { background-color:bisque;font-weight:bold }
</STYLE>
</HEAD>
<BODY>
<TABLE border="1">
<tr>
<TD CLASS="HDR" align="Center" >Qty</TD>
</tr>
<tr>
<TD fONT="Arial" >       QTY</TD>
</tr>

<xsl:for-each select="NewDataSet/Table1" >
<tr>
<TD><xsl:value-of select="Qty"/></TD>
</tr>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Jul 20 '05 #1
4 8460
In article <ca**************************@posting.google.com >,
Purdy <pu*****@hotmail.com> wrote:

% on one of the fields i need the word 'qty' but i need it to look like
% ' qty' with 5 white spaces. i am able to do that in my xslt and
% the export to Excel looks fine also.

[...]

% <TD fONT="Arial" >       QTY</TD>

  is a non-breakable space, which looks like a space, but is not one.
You could try , or just a space.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #2
&#160 did come thru as a space in excel which was what i wanted but it
wouldnt strip when i did trim(qty).
i tried a space but when it came thru in excel the space wasn't there.
i also tried  and that didn't work either.
  is a non-breakable space, which looks like a space, but is not one.
You could try , or just a space.

Jul 20 '05 #3
In article <ca**************************@posting.google.com >,
Purdy <pu*****@hotmail.com> wrote:
% &#160 did come thru as a space in excel which was what i wanted but it
% wouldnt strip when i did trim(qty).

My guess is that it came through as  , which looks like a space,
but is not one. How about explicitly changing chr(160) to space before
trimming?

Or, you could deal with your real problem -- if you require five spaces,
in your input, you're doing something wrong, probably in the way you're
formatting your document.

--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #4
i inherited this app from someone prior to me. you are right in saying
it shouldn't be progrmd this way.
i took out the spaces and i could have put my life on the fact it
wouldn't accept the data without 5 spaces, but now it's taking it
without any spaces so this is a closed discussion. thx for your help!
i'll keep it in mind on future projects. :0)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #5

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

Similar topics

9
by: Thomas Mlynarczyk | last post by:
Which is the simplest way to remove all whitespace from a string? Is there a simpler method than a regex replace? Or how can I tell a regex pattern to ignore all whitespace in my subject string?...
5
by: McKirahan | last post by:
I'd like to use regular expressions to remove extraneous Carriage Return Line Feeds (CrLf) from a textarea before the form is submitted. I'd like to remove all trailing CrLf's and convert all...
3
by: Aaron | last post by:
is there a way to remove all white spaces in the html output? ie. everything as one line.
5
by: Donald Canton | last post by:
What's the best way to remove trailing whitespace from a string? For example: "John C. Doe \t" would become "John C. Doe". Thanks.
3
by: VK | last post by:
If it was already answered somewhere, I'll be glad to be pointed to (after the necessary comments on my search abilities :-) I need as booletproof as possible way to strip out whitespaces from...
7
by: Bosconian | last post by:
I know that str.replace(/^\s+|\s+$/g,''); will trim a string of space, but what about removing extra spaces from the middle? Where "hello world"
10
by: Hermann.Richter | last post by:
Is there any way to remove automatically all blank chars from the html sent to the client?? Example: ---------------------------------------------------------------- <? echo "HTML tags...
15
by: CI | last post by:
I have the following XML file <Book> <Chapters> <Chapter number="1"/> <Chapter number="2"/> </Chapters> <Colors> <Color RGB="255"/> <Color RGB="211" name="Red"/>
15
by: morleyc | last post by:
Hi, i would like to remove a number of characters from my string (\t \r \n which are throughout the string), i know regex can do this but i have no idea how. Any pointers much appreciated. Chris
4
by: howa | last post by:
Consider an example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <style> a { background-color:red;} </style> </head>
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.