473,386 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Re: First character a space in tag?

Gabe wrote:
<name>.John Smith</name>
and I want it to print as:
.John Smith
where "." = a space.
You can do exactly that, exactly as you've shown it:
<nameJohn Smith</name>

But...
I need to do this because the software I am using requires the
following code for a multi-select drop down list.
Now you aren't talking about XML -- you're talking about the behavior of
the tool you're passing the XML to.

Assuming it's a browser, that's your problem; browsers are designed to
reformat text, and consider spaces in text to be only hints. You can try
replacing the space with a Required Blank character:
<name> John Smith</name>
Required Blank displays as a space but is not subject to the browser's
reformatting.

If the tool isn't a browser, you need to understand that tool's rules
for when spaces are and aren't preserved.

If you need additional help, it would be really useful to know exactly
what you're feeding this document to.
Jul 18 '08 #1
2 1609
On Jul 18, 4:24 pm, "Joseph J. Kesselman" <keshlam-nos...@comcast.net>
wrote:
Gabe wrote:
<name>.John Smith</name>
and I want it to print as:
.John Smith
where "." = a space.

You can do exactly that, exactly as you've shown it:
<nameJohn Smith</name>

But...
I need to do this because the software I am using requires the
following code for a multi-select drop down list.

Now you aren't talking about XML -- you're talking about the behavior of
the tool you're passing the XML to.

Assuming it's a browser, that's your problem; browsers are designed to
reformat text, and consider spaces in text to be only hints. You can try
replacing the space with a Required Blank character:
<name> John Smith</name>
Required Blank displays as a space but is not subject to the browser's
reformatting.

If the tool isn't a browser, you need to understand that tool's rules
for when spaces are and aren't preserved.

If you need additional help, it would be really useful to know exactly
what you're feeding this document to.
Thanks Joseph for answering my question.

It is actually a forms editor where I first import a wmf form. Then I
do most of the xml coding with a WYSIWYG editor. When I save the file
with the leading space and reopen the file, the space is gone.

I had tried your solution before posting to this group. It works great
when I test it, but then when I save the file and reopen it, it does
this:

<name>&amp;#160;John Smith</name>

which is not what I want.

I will talk with the developer of the application about this.

Thanks for your help,

Gabe
Jul 18 '08 #2
It is actually a forms editor where I first import a wmf form. Then I
do most of the xml coding with a WYSIWYG editor. When I save the file
with the leading space and reopen the file, the space is gone.
Sounds like the editor is making unjustified assumptions. Figure out how
to reconfigure it. Or change tools.
<name>&amp;#160;John Smith</name>
which is not what I want.
Find out how that editor expects you to enter the required blank
character. Or change tools.
Jul 18 '08 #3

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

Similar topics

12
by: lawrence | last post by:
I'm bad at regular expressions. Is this how I would look for any set of characters that go more than 60 characters without a white space? ..{60} Also, does this match a block of PHP in an...
9
by: Christian Roth | last post by:
Hello, when using this "identity" processing sheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="iso-8859-1" /> ...
18
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also...
2
by: Kannan | last post by:
In section 7.19.6.1 on ISO C specification, it says about a format character "space". When and how we will use this "space" format? I mean is there a usage, for e.g. like printf("%space",...); ? ...
2
by: coolvixs | last post by:
hi, i have some data in mysql in a column like this: 6.1.01 Financial Regulations 3.32.02 Academic Counseling what iam selecting is select by letter A, B, C...Z. so my first char in the...
8
by: shapper | last post by:
Hello, I have a string which holds a text. Is it possible to create a substring which uses the first N words of that string? Thanks, Miguel
20
by: Jukka K. Korpela | last post by:
I recently noticed, once again, how the common implementation of italics can really disturb. I'm referring to the common phenomenon that there is by default too little spacing after italics text,...
25
by: ehabaziz2001 | last post by:
Why I can not begin my subscript of character arrrays with 0. In this program I can not do : do { na=getchar(); i++; na=getchar(); } while (na!='\n');
3
by: kvnsmnsn | last post by:
I've written the following Javascript file that includes an input text field and an output text field, the latter of which is initialized to zero. Each time the user enters a number in the input...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.