help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:   and nXML mode


From: Stefan Monnier
Subject: Re:   and nXML mode
Date: Wed, 11 Aug 2021 01:45:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> Is there a reason why nXML mode refuses to consider   entities as
>> legit in a document that starts with:
>>
>> <!DOCTYPE html>
>> <html xmlns="http://www.w3.org/1999/xhtml";>
>
> If you view that as an XML document (which is what nXML deals with),
> without any preconceived knowledge of HTML5, there is nothing to
> suggest that &nbsp; is legit.
>
> In XML, an entity can be defined inline within the doctype declaration:
>
>     <!DOCTYPE html [
>       <!ENTITY nbsp "&#a0;">
>     ]>

My understanding is that XML wants to be "parsable" without knowing
anything about the schema being used, and that this notion of parsing
includes conversion of `&<foo>;` entities, so basically XML only allows
the 4 or 5 predefined/builtin entities and that's it.

>     <!ENTITY nbsp   "&#160;" ><!-- no-break space = non-breaking
> space, U+00A0 ISOnum -->

I thought the recommended way to "do &bnsp;" in XML is to use an
actual NBSP character (because XML can use utf-8).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]