xml:id Version 1.0 QA Review

This is a review of xml:id document found at http://www.w3.org/TR/2004/WD-xml-id-20040407. Comments are identified by a QA-XXX where XXX is a number.


Abstract

This document unreserves the attribute xml:id as a universal spelling for ID attributes, and defines processing of this attribute to identify IDs in the absence of validation.

QA-001: You might want to precise that it's for XML applications, technologies.

Table of Contents

1 Introduction
2 Terminology
3 Syntax
4 Usage
4.1 With DTD Validation
4.2 With XML Schema Validation
4.3 Behaviour when no xml:id declaration is available
4.3.1 Using the attribute type infoset property
4.3.2 Using the type definition family of properties respectively.
5 Conformance
5.1 XML Information Set Conformance

Appendices

A References
B References (Non-Normative)
C Impacts on other Standards (Non-Normative)
D Open Issues (Non-normative)

QA-002: The markup of your document is sometimes weird, not semantically correct or inappropriate, please improve that part. For example, you table of contents, use br instead of nested ul/li. You make also an weird use of title attribute.


1 Introduction

[XML 1.0] provides a mechanism for annotating elements with unique identifiers. This mechanism consists of declaring the type of an attribute as "ID", after which the parser will validate that the ID value matches the allowed lexical form, that the value is unique within the XML document, and that each element has a single unique identifier. To declare IDs within an XML document, one need only provide an internal or external subset containing such a declaration (QA-003: This previous sentence is unclear, please rephrase it). However, processing of this information if present in the external subset is optional for conformant XML processors, leaving no guarantee that all consumers of the XML document will be able to successfully recognize the identifiers.

QA-004: What about rewriting the second sentence as:

[XML 1.0] provides a mechanism for annotating elements with unique identifiers. This mechanism consists of declaring the type of an attribute as "ID", therefore a parser will be able:

  • to validate that the ID value matches the allowed lexical form,
  • to ensure that the value is unique within the XML document,
  • to verify that each element has a single unique identifier.

Identifiers can be declared through external mechanisms as well. Of particular interest is [XML Schemas] which provides a type "xs:ID" with the same uniqueness and validity constraints as XML does. However, there are no guarantees that consumers will have the "correct" schema available, nor that they will process it if they do.

A mechanism allowing unique element identifiers to be recognized by all conformant XML processors, whether they validate or not, is desirable in making XML sub-resource linking robust.

An additional problem is that DTD-based and XML Schema-based identifiers are exposed through different conceptual mechanisms - the [attribute type] infoset property, and the [type definition] family of properties respectively. A uniform mechanism for recognizing identifiers is desirable.

2 Terminology

[Definition: The key words must, must not, required, shall, shall not, should, should not, recommended, may, and optional in this specification are to be interpreted as described in [IETF RFC 2119].]

QA-005: Did you put this sentence between Square bracket because you are not sure yet of using this language. Move this section in the Conformance clause.

3 Syntax

This specification unreserves the attribute "xml:id" for use as a common syntax for identifiers in XML. Authors of XML documents are encouraged to name their ID attributes "xml:id" to increase the interoperability of these identifiers on the Web.

QA-006: Weird sentence. How using xml:id will improve the interoperability of identifiers? Did you mean increase the interoperability of XML documents/technologies?

In namespace-aware XML processors, the "xml" prefix is bound to the namespace name http://www.w3.org/XML/1998/namespace as described in Namespaces in XML [Namespaces in XML]. Note that xml:id can be still used by non-namespace-aware processors.

QA-007: Are you sure it will be always valid? You are using the term XML as a family term or as a specific version of XML? Does the version of XML could impact on this feature?

QA-008: Your section is title Syntax and you don't give any formalism for the syntax. Would it be reasonnable to use the infoset for it?

QA-009: Is this section normative?

4 Usage

QA-010: This section is informative? If yes, say so. If not make it clear too. To help readers of your specification to understand what parts are normative and what parts are informative, specify in the Conformance clause how you identify them.

QA-011: You may want to rename this section with something which is a bit more explicit.

4.1 With DTD Validation

DTD authors are encouraged to exclusively use xml:id in their DTDs to indicate element identifiers.

The following (non-normative) DTD fragment illustrates a sample declaration for the xml:id attribute:

<!ATTLIST someElement
    xml:id     ID          #IMPLIED
>

DTD authors should not declare xml:id as something other than ID (for instance CDATA) for interoperability with XML Schema- and non-validating processors. DTD authors should not declare attributes other than xml:id as type ID for interoperability with XML Schema- and non-validating processors. No interoperability guarantees are provided in these cases.

QA-012: why not saying something like:

DTD authors should declare xml:id as something exclusively of type ID (for instance CDATA) for interoperability with XML Schema- and non-validating processors.

DTD authors should only use xml:id for attributes with the type ID for interoperability with XML Schema- and non-validating processors. No interoperability guarantees are provided in these cases.

Validating consumers of documents using properly declared xml:id attributes can recognize IDs through the [attribute type] property.

QA-013: This last sentence is not testable per your requirements. It doesn't use one of your conformance keywords. If it's a requirement, say it and use a proper wording.

4.2 With XML Schema Validation

XML Schema authors are encouraged to exclusively use xml:id in their schemas to indicate element identifiers.

The following (non-normative) XML Schema fragment illustrates a sample declaration for the xml:id attribute:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.w3.org/1998/XML/Namespace">

    <xs:attribute name="xml:id" type="xs:ID"/>

</xs:schema>

XML Schema authors should not declare xml:id as something other than xs:ID (for instance xs:string) for interoperability with DTD- and non-validating processors. XML Schema authors should not declare attributes other than xml:id as type xs:ID for interoperability with DTD- and non-validating processors. No interoperability guarantees are provided in these cases.

QA-014: Same comment than QA-012

Consumers of documents validating the xml:id attributes against an appropriate schema can recognize IDs through the [type definition] family of PSVI properties.

QA-015: This last sentence is not testable per your requirements. It doesn't use one of your conformance keywords. If it's a requirement, say it and use a proper wording.

Applications can recognize xml:id attributes as IDs by conceptually using a Minimally Conforming Schema Processor processing the schema above.

QA-016: Make your reference clear and explicit in the document, if you are expecting a mandatory behaviour.

Note that the effects of a Minimally Conforming Schema Processor, processing the above schema, are approximated by simply looking for attributes named xml:id, ensuring the value of such attributes has the correct lexical form (NCName), and the value is unique within the document.

Issue (id-minimal-validation): Review with XML Schema WG our use of the Minimally Conforming Schema Processor.

4.3 Behaviour when no xml:id declaration is available

Issue (id-declaration): Strictly speaking the behaviour exposed here should not apply if xml:id is declared in a recognized part of the internal subset, in which case the default processing of [XML 1.0] is sufficient even if the processor is not validating.

A processor that does neither DTD nor XML Schema validation must report xml:id attributes found in documents using [XML Information Set] properties, assuming the following condition:

QA-017: The second list item doesn't contain on your keyword for conformance. It makes it ambiguous if it's required. The wording assuming in the introductory sentence is bad. Assume leaves an ambiguity. Did you mean s/assuming/requiring/

If those conditions are not satisfied then the processor should report the error to the application.

If those conditions are satisfied then the processor must report the xml:id attribute in at least one of the following ways:

Issue (id-strictness): Those rules are stricter than the ones a non-validating XML processor would apply, should those strict rules be relaxed?

4.3.1 Using the [attribute type] infoset property

The processor can report the IDness of the attribute in a DTD compatible manner by setting the [attribute type] infoset property of the attribute to ID.

4.3.2 Using the [type definition] family of properties respectively.

The processor can report the IDness of the attribute in an XML Schemas compatible manner by setting the PSVI [type definition] infoset property of the attribute to ID.

Issue (set-type-defintion): Is this option necessary since a minimally conformant processor can already do this (see 4.2 With XML Schema Validation).

5 Conformance

Conformance to xml:id for applications that rely on XML processors using DTD or XML Schemas validation consist in the use of the xml:id construct in the DTD or XML Schemas as explained in 4.1 With DTD Validation and 4.2 With XML Schema Validation, and by the conformance to the validation rules of DTDs and XML Schemas.

Conformance to xml:id for applications that rely on non-validating XML processor is defined by the recognition of xml:id attributes as defined in 4.3 Behaviour when no xml:id declaration is available.

5.1 XML Information Set Conformance

This specification conforms to the [XML Information Set]. The following information items must be present in the input infosets to enable correct processing:

In addition, the following properties might be present in the output infoset:

QA-018: might is not one of your defined keyword, which is a bit weird for something which is part of the Conformance section

Appendices

A References

IETF RFC 2119
RFC 2119: Key words for use in RFCs to Indicate Requirement Levels. Internet Engineering Task Force, 1997. (See http://www.ietf.org/rfc/rfc2119.txt.)
Namespaces in XML
Tim Bray, Dave Hollander, and Andrew Layman, editors. Namespaces in XML. World Wide Web Consortium, 1999. (See http://www.w3.org/TR/REC-xml-names/.)
XML 1.0
Tim Bray, Jean Paoli, C.M. Sperberg-McQueen, and Eve Maler, editors. Extensible Markup Language (XML) 1.0 (Second Edition). World Wide Web Consortium, 1998. (See http://www.w3.org/TR/REC-xml.)
XML Information Set
John Cowan and Richard Tobin, editors. XML Information Set (Second Edition). World Wide Web Consortium, 2004. (See http://www.w3.org/TR/xml-infoset/.)

B References (Non-Normative)

XML Schemas
Henry S. Thompson, David Beech, Murray Maloney, Noah Mendelsohn, editors. XML Schema Part 1: Structures. World Wide Web Consortium, 2001. (See http://www.w3.org/TR/xmlschema-1/.)

C Impacts on other Standards (Non-Normative)

QA-019: This section is very interesting even if informative it might interest more than one developpers. If you think it's worthwhile to develop it, please do.

D Open Issues (Non-Normative)