how to add non breaking space ?

Neven Has haski at sezampro.yu
Thu Apr 18 12:04:54 PDT 2002


On Thu, Apr 18, 2002 at 06:26:01PM +0200, Fabien Steinmetz wrote:
> Adding a non breaking space in my profiles is quite difficult I
> notices. The   doesn't work If I use &U00A0; or, &UA0;, or &xA0;
> it doesn't work as expected, in fact it adds a space, but another
> character before the space.

It's not a XML issue...

> I want to do that because I use <setenv mode="append"> and want my
> spaces in my <value> abc </value> tag to be really present, not that
> it disappears when I am in nALFS.

....it's a nALFS one. All leading and trailing white space in
element's content is trimmed. I never thought it could hurt anyone,
but it obviously does.

I'll remove that trimming for the next version, although then all
handlers that don't need it will have to trim it them selves. Not very
pretty, but I guess it does make more sense that a way - they'll be more
independent that way, not relaying on the main code stripping their
beloved space. ;)

In the mean time, you can apply the attached patch. Just note that
with this patch, nALFS will leave _all_ element content's white space,
which might (or not) cause some problems when multi-line content is used
(for example).


Neven
-------------- next part --------------
===== libXML-tree.c 1.11 vs edited =====
--- 1.11/src/libXML-tree.c	Wed Apr 17 15:08:28 2002
+++ edited/libXML-tree.c	Thu Apr 18 20:42:58 2002
@@ -112,7 +112,6 @@
 			&& node->children->type == XML_TEXT_NODE
 			&& node->children->next == NULL) {
 				el->content = xstrdup(node->children->content);
-				el->content = trim_space(el->content);
 			}
 
 			set_attributes(el, node);


More information about the alfs-discuss mailing list