Re: [xsl] Empty object

Subject: Re: [xsl] Empty object
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 28 Jan 2004 21:39:23 GMT
> <!DOCTYPE holdspace[<!ENTITY nbsp "&nbsp ;">]> <--no spaces &nbsp;
> when I view this xml file I see <OBJECT>&nbsp;</OBJECT>

That is defining the entity to be itself which would put the xml parser
into an infinte loop, except self definition is a fatal error so if you
get any output from any XML system given that input, the system has a
bug. There is nothing magic about the entity name "nbsp" you can call
the entity anything you like, but you have to define it to be characyer
160 if you want it to be a no breaking space, but really why make it
hard on your self, why bother with entities at all and why not just do
<object>& # 1 6 0 ;</object>
and enter the character by reference.

Did you read the nbsp page in the FAQ, I don't know how to rephrase what
I have said before: XSLT can't know whether the input had an nbsp entity
or any other way of entering the character so it can not "keep" the
reference, it has gone by the time XSLT starts, having been replaced by
its definition.
If you defined nbsp to be a non breaking space, that's what XSLT would
see.

David


-- 
http://www.dcarlisle.demon.co.uk/matthew

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread