What is the specification of XML?
Asked Answered
S

2

1

Where can I find the specification of XML?

W3C document is just a recommendation?

https://www.oracle.com/technical-resources/articles/srivastava-namespaces.html

But here's a twist: although the W3C Namespaces in XML Recommendation declares that the namespace name should be an IRI, it enforces no such constraint. Therefore, I could also use something like:

<someElement xmlns:pfx=" foo" />

which is perfectly legal

Then, what makes an XML legal?

Sullivan answered 19/11, 2022 at 6:57 Comment(1)
Don't get hung up on terminology. "Recommendation" is just W3C's name for a phase in a standard's lifetime. "W3C recommends the wide deployment of a Recommendation as a standard for the Web. These documents MAY be cited as W3C standards." So rather than "just" a recommendation, it's the most authoritative thing the W3C publishes. The XML 1.1 recommendation can therefore legitimately be called the standard (though many implementations still follow XML 1.0).Generous
H
4

Two separate questions here.

Firstly, the term "Recommendation" is used by W3C for its most definitive specifications. The term has a history, it has always been used for example by CCITT and ITU for the specifications under which the world's phone networks operate. They avoid the term "Standard" because these documents have no legislative force, and possibly also originally to avoid any anti-trust challenges.

Secondly, does a namespace name have to be a valid URI (or IRI)? The specification is ambiguous on the point. On the one hand it says clearly:

Definition: An XML namespace is identified by an IRI reference

One the other hand, in section 7 ("Conformance") it states no requirement that namesspaces should be valid IRIs. This is not an accidental omission; the working group consciously decided to avoid making this a requirement. You might think that's a pretty unsatisfactory state of affairs, but if you've ever worked on standards, you'll know how compromises like that are reached.

Underlying this is the fact that there were people who thought namespace names should merely be names, and others who thought they should be some kind of pointer to a specification of the semantics of the namespace, and the spec represents a working compromise between these positions.

There's a further twist to the story. If you think that namespaces should be references to some resource on the web, then it follows that relative URI references like "foo" should be allowed. This led to a fierce argument, which culminated in a W3C decision that relative URIs were deprecated and should be avoided. So you're left with the odd situation that absolute URIs are definitely OK, relative URIs are definitely deprecated, but strings which are neither absolute URIs nor relative URI references are quietly tolerated.

Huesman answered 19/11, 2022 at 13:55 Comment(0)
K
1

The specification for XML is W3C Extensible Markup Language (XML) 1.0 (Fifth Edition), or the newer v1.1.

What makes an XML document legal is indeed its conformance to the above standards document.

  • A legal XML document is commonly said to be well-formed.
  • A well-formed XML document that follows the recommendations of W3C Namespaces in XML 1.0 is further said to be namespace-well-formed.
  • A well-formed XML document that adheres to an XML schema is said to be valid. (The spec specifies a DTD, but valid has also come to be used to refer to compliance with alternative XML schemas – XSD, RELAX NG, etc.)

See also

Kingbolt answered 19/11, 2022 at 15:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.