all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Dr. Jennifer Nussbaum" <bg271828@yahoo.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Basic question on choosing nxml-mode schema
Date: Thu, 10 Nov 2016 12:05:46 -0500	[thread overview]
Message-ID: <jwv4m3fguha.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <1772356535.1551835.1478788667810@mail.yahoo.com> (Jennifer Nussbaum's message of "Thu, 10 Nov 2016 14:37:47 +0000 (UTC)")

> gives me only two problems: this rejects 'lang="EN"' with "Attribute
> not allowed"; and it rejects <style> as "Element not allowed in this
> context", even when appearing within a <body> area.

I'm not very knowledgeable in XML/SGML/HTML, but I do know that HTML5
has a much tougher stance on what is allowed where, to try and help
enforce a clean separation between content (in HTML) and presentation
(in CSS).

So maybe these are bugs in html5-schema or in nxml-mode, but my gut
feeling is that it might simply be because these constructs are not
allowed in HTML5 any more.

[ Reaches for his web browser... ]
Hmm... apparently the "lang" attribute should be allowed anywhere in
HTML5, so this looks like a bug in html5-schema.

But w.r.t the `style` tag, I see:

    Note: If the "scoped" attribute is not used, each <style> tag must
    be located in the head section.

so nXml is probably right to signal an error when it sees a `style` in
the body.

> <!doctype html>
> <html lang="en">

My memory is fuzzy, but isn't XML case-sensitive (in contrast to SGML?).
So I think you want

    <!DOCTYPE html>
    <html lang="en">

I usually start my documents with

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">

IIRC some of those lines are redundant but server to make the document
valid both as HTML and as XML.

> then it rejects "doctype" with "Unknown markup declaration", the
> "lang" as above, "Referenced entity has not been defined" for &ndash;
> and related, and <style> as above.

W.r.t &ndash, I recommend you use an actual ndash character rather than
an entity reference.  XML is supposed to readable/parseable without
knowing the document type and schema, so the only entities you can
reliably use are those few entities that are valid in all document
types, i.e. &amp;, &lt; &quot; &apos; and &gt;.
To make up for that restriction, you get to use the full Unicode set
of characters.


        Stefan



  reply	other threads:[~2016-11-10 17:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1447994335.988177.1478636797036.ref@mail.yahoo.com>
2016-11-08 20:26 ` Basic question on choosing nxml-mode schema Dr. Jennifer Nussbaum
2016-11-09  9:06   ` tomas
2016-11-09  9:38     ` Yuri Khan
2016-11-09 19:58       ` Stefan Monnier
2016-11-10 14:37         ` Dr. Jennifer Nussbaum
2016-11-10 17:05           ` Stefan Monnier [this message]
2016-11-09 21:02       ` tomas

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=jwv4m3fguha.fsf-monnier+Inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bg271828@yahoo.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.