473,654 Members | 3,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[XSL XHTML]   entity problem

In XHTML the entity nbsp stands for  

A normal space like " " is also displayed as an normal space,
but multiple spaces like " " are interpreted as 1 space in the
xhtml page.
So there comes the   in handy: with " &nbs p;" you have two
spaces. So with the nbsp entity you can create multiple spaces (in the display).

Now i have an xml file with   entities,
i put it in an xsl-file that know xhtml entities.
But the output of this:

" &nbs p;"

is translated (correctly) to:

" "

But now the whole point of the   entity in xhtml is gone!!
How do you solve this problem
Jul 20 '05 #1
12 6024
In article <42************ ***********@new s.wanadoo.nl>,
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:

&nbsp; is defined as   which is a reference to the
non-breaking-space character. If you have a way to type it in, you
can perfectly well use that character directly instead of using an
entity or reference, and it is different from an ordinary space
character even though it may look the same when you look at the file.
"&nbsp;&nbsp ;"

is translated (correctly) to:

" "


So those blank spaces between the quotes should be perfectly good
non-breaking-space characters, not ordinary spaces, and should work
just like &nbsp; references in XHTML.

-- Richard
Jul 20 '05 #2
Richard Tobin wrote:
In article <42************ ***********@new s.wanadoo.nl>,
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:

&nbsp; is defined as   which is a reference to the
non-breaking-space character. If you have a way to type it in, you
can perfectly well use that character directly instead of using an
entity or reference, and it is different from an ordinary space
character even though it may look the same when you look at the file.

"&nbsp;&nbsp; "

is translated (correctly) to:

" "

So those blank spaces between the quotes should be perfectly good
non-breaking-space characters, not ordinary spaces, and should work
just like &nbsp; references in XHTML.

-- Richard


so you mean that " " and " " can be different characters?
Jul 20 '05 #3
In article <42************ **********@news .wanadoo.nl>,
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:
so you mean that " " and " " can be different characters?


Yes, Unicode has several different characters that may look like that.

-- Richard
Jul 20 '05 #4
Richard Tobin wrote:
In article <42************ **********@news .wanadoo.nl>,
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:

so you mean that " " and " " can be different characters?

Yes, Unicode has several different characters that may look like that.

-- Richard


i have foudn a smart solution:

<!DOCTYPE stylesheet [
<!ENTITY nbsp
"<xsl:text disable-output-escaping='yes'> &amp;nbsp;</xsl:text>">
]>

now it works
Jul 20 '05 #5
In article <42************ ***********@new s.wanadoo.nl>,
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:
now it works


It should have worked anyway!

-- Richard

Jul 20 '05 #6


Tjerk Wolterink wrote:
i have foudn a smart solution:

<!DOCTYPE stylesheet [
<!ENTITY nbsp
"<xsl:text disable-output-escaping='yes'> &amp;nbsp;</xsl:text>">
]>


Use it if your circumstances allow it and require it but be aware that
disable-output-escaping is an optional feature that is not supported by
every XSLT processor respectively output mode, for instance when the
result of the transformation is a tree that is not serialized then it
usually doesn't work.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #7
Richard Tobin wrote:
In article <42************ ***********@new s.wanadoo.nl>,
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:
now it works

It should have worked anyway!

-- Richard


i know what you mean, maybe the output document is valid and the " " is really a
non breaking space. the fact is that browsers like IE do not treat it like that.

But anyways, thanks for your help
Jul 20 '05 #8
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:
i know what you mean, maybe the output document is valid
How would validity be relevant here? (I suspect you are using the word
"valid" in some non-XML and not-so-well defined meaning.)
and the " " is really a non breaking space.
No, what you have typed here is surely a normal space. You could not
have included a no-break space (that's the term, btw) into your
posting, since your message headers specify 7bit transfer.

I wonder why you use &nbsp; in the first place. Why don't you simply
write no-break spaces in whatever encoding you are using? If your
authoring tool does not let you type them easily, maybe you need a
better tool, or to find out how to define keyboard macros in the tool
you are using, or something. Even in Notepad you can type no-break
spaces. (Typing Alt 0160 is not very convenient, but it's comparable to
typing the six characters &nbsp;.)
the fact is that browsers like IE
do not treat it like that.


The fact is that browsers, even IE, treat the no-break space exactly as
the &nbsp; or   reference when processing an HTML document. You
have done something wrong. In the absence of specific information, such
as a URL of a demo page, it is impossible to say what went wrong.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #9
In article <Xn************ *************** **@193.229.0.31 >,
Jukka K. Korpela <jk******@cs.tu t.fi> wrote:
The fact is that browsers, even IE, treat the no-break space exactly as
the &nbsp; or   reference when processing an HTML document. You
have done something wrong. In the absence of specific information, such
as a URL of a demo page, it is impossible to say what went wrong.


If you want to try to track down the problem, you could try setting
the output encoding of your stylesheet to ascii (using the encoding
attribute of the xsl:output element). The processor will then have to
use a character reference to output any non-breaking spaces (since
they aren't in the ascii character set), so you will be able to see
them more easily.

-- Richard
Jul 20 '05 #10

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

Similar topics

7
3113
by: Andy Fish | last post by:
Hi, I'm stuck with an XSL problem - can anyone give me any hints? I have some XML with nested formatting tags like this: <text> this is plain <bold> this is bold
13
6347
by: rbronson1976 | last post by:
Hi all, I have a very simple page that Firefox has problems with: www.absolutejava.com/testing.htm First of all, this page seems to be perfectly valid XHTML Strict. Both the W3C validator as well as Page Valet indicate it is valid. The page is being served with the proper MIME type of "application/xhtml+xml". Unfortunately, Firefox will not display the page due to a non-breaking
9
5814
by: Jouni Karppinen | last post by:
I create a HTMLTable in my C# code and then add rows and cells into that table. I'm trying to set top and bottom border for each cell by using stylesheet and it works as far as cell has some text in it. If cell has no content at all, the borders do not show up (..strange) So I tried to insert text inside each cell which has no other content inside. Cell content is set in code:
14
2374
by: madtom1999 | last post by:
I'm trying to put a non-breaking space ( or any other entity for that matter) into a node eg: node.nodeValue+='&nbsp'; however the actual code is written in the html -ie it displays as >&nbsp;< and not > < any ideas?
3
8916
by: yawnmoth | last post by:
<? echo 'a'.trim(html_entity_decode('&nbsp;a&nbsp;')).'a'; ?> Shouldn't PHP output aaa? Looking at the documentation for trim I see that it doesn't support chr(0xA0) (eg. html_entity_decode('&nbsp;')), but it seems to me like it ought to...
0
1285
by: akg250978 | last post by:
hello! i hope any1 in this forum can help me with my xsl problem, i am quite new to this programming and learning as i go along, this all part of my work, so for i was doing great till i came across this problem? the problem is my dropdown menu, the drop down is in html and when u select on of the option the value in theory should go in the xsl fields code below! it works if u just made it a input field, but no in the dropdown, any1 can...
28
13185
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd yow But, in firefox, for same html, getting this:
7
49905
by: 一首诗 | last post by:
Is there any simple way to solve this problem?
7
9740
by: Sebarry | last post by:
Hi, I'm having trouble creating a blank table row in Javascript using document.createElement( '&nbsp;' ). When I look at the generated source it has intrepreted it as <td>&amp;nbsp;</td>. What do I need to do? I've tried using single quotes, double quotes and backslash. Thanks, Sean
0
8815
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...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8593
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
7306
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
6161
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
5622
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();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
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.