[Home] [By Thread] [By Date] [Recent Entries]

  • From: Pete Cordell <pete++xmldev@c...>
  • To: Amelia A Lewis <amyzing@t...>
  • Date: Mon, 26 Jul 2021 19:36:56 +0100

On 26/07/2021 18:43, Amelia A Lewis wrote:
Since this would be incompatible with XML+Namespaces-in-XML anyway, use
colon instead of dot as your delimiter:

<com:example:myvocabulary:top>
     <middle />
</com:example:myvocabulary:top>

which would be equivalent to:

<com:example:myvocabulary:top>
     <com:example:myvocabulary:middle />
</com:example:myvocabulary:top>

This also helps to underscore that while domain names guarantee (FSDO
"guarantee") uniqueness, it is not required that the namespace part of
the name be a domain name, just that it be probably-unique. The abuse
of the colon also helps to immediately identify this as
not-XML+Namespaces-in-XML.
Agreed, colon works nicely too.

And "encouraged" to be domain name based is probably the best one can hope for.

(For a new syntax you could even say that an end tag adopts the
namespace of its start tag if it is not fully qualified, for example:

<com:example:myvocabulary:top>
     <middle />
</top>

That last bit is a nice touch. When manually writing XML, forgetting to
prefix the end tag is my most common typing error.

The syntax, using both forms of minimization, produces a much higher
signal:noise ratio for a single-namespace document than XML with a
namespace bound to a non-default prefix (granted that it's only a
slight improvement over the equivalent single-namespace document bound
to the default prefix). That benefit increases as additional namespaces
are added (as a rule, documents containing foreign-namespace elements
contain those elements in single-namespace blocks, in my experience).

Global attributes are equally simple. Importantly, I think, the current
syntax for (global) attributes from namespaces with reserved prefixes
can be preserved here: xml:id, xml:base, xml:lang, xsi:type, but these
reserved short prefixes (as they are now) become reserved short
namespaces. For that matter, W3C could fund itself (a little) by
selling a registry service for well-known single-part namespaces
(canonically, domain names contain a minimum of two parts, so all
single-part namespaces are potentially administratively controllable by
a single entity).
That's a nice feature. And the fact registered short prefixes fits in so neatly with the standard prefixes is very appealing.

Pete.
--
---------------------------------------------------------------------
Pete Cordell
Codalogic Ltd
Read & write XML in C++, http://www.xml2cpp.com
---------------------------------------------------------------------




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member