From a4854d865dd0eb7d5e53dd37961c9b9f5ae86252 Mon Sep 17 00:00:00 2001 From: James Clark Date: Mon, 16 Mar 2020 10:03:16 +0700 Subject: [PATCH] Deal better with namespace undeclaration --- lang/spec.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lang/spec.html b/lang/spec.html index ee149886..c428dcf8 100644 --- a/lang/spec.html +++ b/lang/spec.html @@ -1048,9 +1048,10 @@
XML namespaces
xml. If there is already a namespace declaration in the [namespace attributes] that declares a prefix with that namespace name, then that prefix is used. Otherwise if there is a namespace declaration in the in-scope namespaces -that declares a prefix with that namespace and it is not redeclared by the -[namespace attributes], then that prefix is used. Otherwise generate a prefix -and add an AII to the [namespace attributes] to declare it. +that declares a prefix with that namespace and it is not redeclared or +undeclared by the [namespace attributes], then that prefix is used. Otherwise +generate a prefix and add an AII to the [namespace attributes] to declare +it.
  • If the EII has no [namespace name] property, but a default namespace declaration is in scope, then an xmlns="" AII is added to the [namespace attributes] property to undeclare the default namespace.
  • @@ -1066,8 +1067,8 @@
    XML namespaces
    already declared as N; if there is one, set the [prefix] property of the EII to P;
  • otherwise, if the [namespace attributes] property does not contain a default -namespace declaration, generate a default namespace declaration for N and add it -to the [namespace attributes] property;
  • +namespace declaration or undeclaration, generate a default namespace declaration +for N and add it to the [namespace attributes] property;
  • otherwise, generate a new prefix P, set the [prefix] property of the EII to P, and add an AII to the [namespace attributes] to declare it.