all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: &nbsp; and nXML mode
Date: Wed, 11 Aug 2021 01:45:22 -0400	[thread overview]
Message-ID: <jwv35rg4jzw.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: CAP_d_8UJ6kCBqgg+MwBK=zTqhgnnbY07JQg7JdYjhBD1PAX1jA@mail.gmail.com

>> Is there a reason why nXML mode refuses to consider &nbsp; 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




  parent reply	other threads:[~2021-08-11  5:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09  2:22 &nbsp; and nXML mode Jean-Christophe Helary
2021-08-09  5:57 ` Yuri Khan
2021-08-11  0:41   ` Jean-Christophe Helary
2021-08-11  5:45   ` Stefan Monnier via Users list for the GNU Emacs text editor [this message]
2021-08-11  6:19     ` Yuri Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv35rg4jzw.fsf-monnier+emacs@gnu.org \
    --to=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.