<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="xmlspec-extended.xsl"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification Version 2.0//EN"
                      "xmlspec.dtd" [
	<!ENTITY year "2004">
	<!ENTITY month "April">
	<!ENTITY MM "04">
	<!ENTITY day "7">
	<!ENTITY DD "07">
	<!ENTITY MMDD "&MM;&DD;">
	<!ENTITY XMLCore-IPR "http://www.w3.org/2002/08/xmlcore-IPR-statements">
	<!ENTITY internalXmlid "http://www.w3.org/XML/Group/&year;/&MM;/WD-xml-id-&year;&MMDD;">
	<!ENTITY externalXmlid "http://www.w3.org/TR/&year;/WD-xml-id-&year;&MMDD;">
	<!ENTITY xmlid "&externalXmlid;">
	<!-- DTD Extensions -->
	<!ENTITY % local.list.class "|options-list">
	<!ELEMENT options-list (item+)>
	<!ATTLIST options-list
	diff (chg | add | del | off) #IMPLIED
		role NMTOKEN #IMPLIED
		id ID #IMPLIED
		spacing (normal | compact) #IMPLIED
>
	<!ATTLIST resolution
	href CDATA #IMPLIED
>
	<!ENTITY % local.loc.class "|loc-content">
	<!ELEMENT loc-content (#PCDATA | acronym)*>
	<!ATTLIST loc-content
	href CDATA #IMPLIED
>
	<!ELEMENT acronym (#PCDATA)>
	<!ATTLIST acronym
	lang CDATA #IMPLIED
		title CDATA #IMPLIED
>
	<!ENTITY copy "&#169;">
	<!-- copyright sign, U+00A9 ISOnum -->
	<!ENTITY reg "&#174;">
	<!-- registered sign = registered trade mark sign,
                                  U+00AE ISOnum -->
]>
<spec w3c-doctype="wd">
	<header>
		<title>xml:id</title>
		<version>Version 1.0</version>
		<w3c-designation>xml-id-&year;&MMDD;</w3c-designation>
		<w3c-doctype>W3C Working Draft</w3c-doctype>
		<pubdate>
			<day>&day;</day>
			<month>&month;</month>
			<year>&year;</year>
		</pubdate>
		<publoc>
			<loc href="&xmlid;">&xmlid;</loc>
		</publoc>
		<altlocs>
			<loc href="&xmlid;/WD-xml-id-&year;&MMDD;.xml">XML</loc>
		</altlocs>
		<latestloc>
			<loc href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</loc>
		</latestloc>
		<authlist>
			<author>
				<name>Jonathan Marsh</name>
				<affiliation>Microsoft</affiliation>
				<email href="mailto:jmarsh@microsoft.com">jmarsh@microsoft.com</email>
			</author>
			<author>
				<name>Daniel Veillard</name>
				<affiliation>Invited Expert</affiliation>
				<email href="mailto:daniel@veillard.com">daniel@veillard.com</email>
			</author>
		</authlist>
		<copyright>
			<p role="copyright">
				<loc href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"> Copyright</loc>&nbsp; &copy; 2004 <loc-content href="http://www.w3.org/">
					<acronym title="World Wide Web Consortium">W3C</acronym>
				</loc-content>
				<sup>&reg;</sup> (<loc-content href="http://www.csail.mit.edu/">
					<acronym title="Massachusetts Institute of Technology">MIT</acronym>
				</loc-content>, <loc-content href="http://www.ercim.org/">
					<acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym>
				</loc-content>, <loc href="http://www.keio.ac.jp/">Keio</loc>), All Rights Reserved. W3C <loc href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</loc>, <loc href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</loc>, <loc href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</loc> and <loc href="http://www.w3.org/Consortium/Legal/copyright-software">software licensing</loc> rules apply.</p>
		</copyright>
		<status>
			<p>
				<emph>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <loc href="http://www.w3.org/TR/">W3C technical reports index</loc> at http://www.w3.org/TR/.</emph>
			</p>
			<p>This document is a <loc href="http://www.w3.org/Consortium/Process-20010208/tr.html#RecsWD">Working Draft</loc> of the W3C. This document has been produced by the <loc href="http://www.w3.org/XML/Core/">W3C XML Core Working Group</loc> as part of the <loc href="http://www.w3.org/XML/Activity">XML Activity</loc>, based on the <loc href="http://www.w3.org/MarkUp/Forms/Group/2002/10/xml-id.html">XML id</loc> (member only) Working Draft produced by the <loc href="http://www.w3.org/MarkUp/">HTML Working Group</loc>.  Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.</p>
			<p>This First Public Working Draft documents the progress made to date in attempting to satisfy the requirements set in the <loc href="http://www.w3.org/TR/2003/WD-xml-id-req-20030806/">xml:id Requirements Working Draft</loc> published on 6 August 2003.</p>
			<p>It should be noted that this first Working Draft does not yet fully address specific interactions between this specification and others.  The intent is for this specification to compose smoothly with other specifications, but some specifications (particularly those not based on the <loc href="http://www.w3.org/TR/xml-infoset">XML Information Set</loc>) may require errata to realize the full benefits of xml:id. These interactions are a topic of study by the Working Group and will be documented in future Working Drafts.</p>
			<p>The public is invited to send comments to the public mailing list <loc href="mailto:public-xml-id@w3.org">public-xml-id@w3.org</loc> (<loc href="http://lists.w3.org/Archives/Public/public-xml-id/">archive</loc>).</p>
			<p>This document has been produced under the <loc href="http://www.w3.org/TR/2002/NOTE-patent-practice-20020124">24 January 2002 CPP</loc> as amended by the <loc href="http://www.w3.org/2004/02/05-pp-transition">W3C Patent Policy Transition Procedure</loc>.  An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) with respect to this specification should disclose the information in accordance with <loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</loc>.  Documentation of intellectual property possibly relevant to this specification  may be found at the <loc href="http://www.w3.org/2002/08/xmlcore-IPR-statements">Working Group's public IPR disclosure page</loc>.</p>
		</status>
		<abstract>
			<p>This document unreserves the attribute <att>xml:id</att> as a universal spelling for ID attributes, and defines processing of this attribute to identify IDs in the absence of validation.</p>
		</abstract>
		<langusage>
			<language id="EN">English</language>
		</langusage>
		<revisiondesc>
			<slist>
				<sitem>July 17, 2003: First Working Draft.</sitem>
				<sitem>March 17, 2004: Second internal Working Draft.</sitem>
			</slist>
		</revisiondesc>
	</header>
	<body>
		<div1 id="intro">
			<head>Introduction</head>
			<p>
				<bibref ref="XML"/> 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.  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.</p>
			<p>Identifiers can be declared through external mechanisms as well.  Of particular interest is <bibref ref="XMLSchemas"/> 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.</p>
			<p>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.</p>
			<p>An additional problem is that DTD-based and XML Schema-based identifiers are exposed through different conceptual mechanisms - the <emph role="infoset-property">attribute type</emph> infoset property, and the <emph role="infoset-property">type definition</emph> family of properties respectively.  A uniform mechanism for recognizing identifiers is desirable.</p>
		</div1>
		<div1 id="terminology">
			<head>Terminology</head>
			<p>
				<termdef id="dt-must" term="Must, May, etc.">The key words 
	<term>must</term>, <term>must not</term>, <term>required</term>,
	<term>shall</term>, <term>shall not</term>, <term>should</term>, 
	<term>should not</term>, <term>recommended</term>, <term>may</term>, 
	and <term>optional</term> in this specification are to be interpreted 
	as described in <bibref ref="RFC2119"/>.</termdef>
			</p>
			<!--	<p><termdef id="dt-infoset" term="infoset">The term <term>information 
	set</term> refers to the output of an XML processor, expressed as a 
	collection of information items and properties as defined by the 
	<bibref ref="XMLIS"/>	specification.</termdef>  In this document 
	the term <emph>infoset</emph> is used as a synonym for 
	<emph>information set</emph>.</p>
-->
		</div1>
		<div1 id="syntax">
			<head>Syntax</head>
			<p>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.</p>
			<p>In namespace-aware XML processors, the "xml" prefix is bound to the namespace 
	name <code>http://www.w3.org/XML/1998/namespace</code> as described in Namespaces in XML
	<bibref ref="XMLNS"/>.  Note that <att>xml:id</att> can be still used by 
	non-namespace-aware processors.</p>
		</div1>
		<div1 id="usage">
			<head>Usage</head>
			<div2 id="with-dtd-validation">
				<head>With DTD Validation</head>
				<p>DTD authors are encouraged to exclusively use <att>xml:id</att> in their DTDs to indicate element identifiers.</p>
				<p>The following (non-normative) DTD fragment illustrates a sample declaration for the <att>xml:id</att> attribute:</p>
				<eg>&lt;!ATTLIST someElement
    xml:id     ID          #IMPLIED
&gt;</eg>
				<p>DTD authors <termref def="dt-must">should not</termref> declare <att>xml:id</att> as something other than <code>ID</code> (for instance CDATA) for interoperability with XML Schema- and non-validating processors.  DTD authors <termref def="dt-must">should not</termref> declare attributes other than <att>xml:id</att> as type ID for interoperability with XML Schema- and non-validating processors.  No interoperability guarantees are provided in these cases.</p>
				<p>Validating consumers of documents using properly declared <att>xml:id</att> attributes can recognize IDs through the <emph role="infoset-property">attribute type</emph> property.</p>
			</div2>
			<div2 id="with-schema-validation">
				<head>With XML Schema Validation</head>
				<p>XML Schema authors are encouraged to exclusively use <att>xml:id</att> in their schemas to indicate element identifiers.</p>
				<p>The following (non-normative) XML Schema fragment illustrates a sample declaration for the <att>xml:id</att> attribute:</p>
				<eg><![CDATA[
<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>
]]></eg>
				<p>XML Schema authors <termref def="dt-must">should not</termref> declare <att>xml:id</att> as something other than <code>xs:ID</code> (for instance <code>xs:string</code>) for interoperability with DTD- and non-validating processors.  XML Schema authors <termref def="dt-must">should not</termref> declare attributes other than <att>xml:id</att> as type <code>xs:ID</code> for interoperability with DTD- and non-validating processors.  No interoperability guarantees are provided in these cases.</p>
				<p>Consumers of documents validating the <att>xml:id</att> attributes against an appropriate schema can recognize IDs through the <emph role="infoset-property">type definition</emph> family of PSVI properties.</p>
				<p>Applications can recognize <att>xml:id</att> attributes as IDs by conceptually using a <loc href="http://www.w3.org/TR/xmlschema-1/#key-minimallyConforming">Minimally Conforming Schema Processor</loc> processing the schema above.</p>
				<p>Note that the effects of a Minimally Conforming Schema Processor, processing the above schema, are approximated by simply looking for attributes named <att>xml:id</att>, ensuring the value of such attributes has the correct lexical form (<loc href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</loc>), and the value is unique within the document.</p>
				<issue id="id-minimal-validation">
					<p>Review with XML Schema WG our use of the Minimally Conforming Schema Processor.</p>
				</issue>
			</div2>
			<div2 id="non-validating-processor">
				<head>Behaviour when no <att>xml:id</att> declaration is available</head>
				<issue id="id-declaration">
					<p>Strictly speaking the behaviour exposed here should
not apply if <att>xml:id</att> is declared in a recognized part of the
internal subset, in which case the default processing of <bibref ref="XML"/>
is sufficient even if the processor is not validating.</p>
				</issue>
				<p>A processor that does neither DTD nor XML Schema validation <termref def="dt-must">must</termref> report <att>xml:id</att> attributes found in documents using <bibref ref="XMLIS"/> properties, assuming the following condition:
		<ulist>
						<item>
							<p>The attribute value <termref def="dt-must">must</termref> be a valid <loc href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</loc>.</p>
						</item>
						<item>
							<p>No other <att>xml:id</att> attribute with the same attribute value has been found earlier in the document.</p>
						</item>
					</ulist>
				</p>
				<p>If those conditions are not satisfied then the processor <termref def="dt-must">should</termref> report the error to the application.</p>
				<p>If those conditions are satisfied then the processor <termref def="dt-must">must</termref> report the <att>xml:id</att> attribute in at least one of the following ways:</p>
				<issue id="id-strictness">
					<p>Those rules are stricter than the ones a non-validating XML
processor would apply, should those strict rules be relaxed?</p>
				</issue>
				<div3 id="Attribute_type">
					<head>Using the <emph role="infoset-property">attribute type</emph> infoset property</head>
					<p> The processor can report the IDness of the attribute in a DTD compatible manner by setting the <emph role="infoset-property">attribute type</emph> infoset property of the attribute to ID.</p>
				</div3>
				<div3 id="type_definition">
					<head>Using the <emph role="infoset-property">type definition</emph> family of properties respectively.</head>
					<p> The processor can report the IDness of the attribute in an XML Schemas compatible manner by setting the PSVI <emph role="infoset-property">type definition</emph> infoset property of the attribute to ID.</p>
					<issue id="set-type-defintion">
						<p>Is this option necessary since a minimally conformant processor can already do this (see <specref ref="with-schema-validation"/>).</p>
					</issue>
				</div3>
			</div2>
		</div1>
		<div1 id="conformance">
			<head>Conformance</head>
			<p>Conformance to <att>xml:id</att> for applications that rely on <loc href="http://www.w3.org/TR/2004/REC-xml-20040204/#dt-xml-proc">XML processors</loc> using DTD or XML Schemas validation consist in the use of the <att>xml:id</att> construct in the DTD or XML Schemas as explained in <specref ref="with-dtd-validation"/> and <specref ref="with-schema-validation"/>, and by the conformance to the validation rules of DTDs and XML Schemas.</p>
			<p>Conformance to <att>xml:id</att> for applications that rely on non-validating <loc href="http://www.w3.org/TR/2004/REC-xml-20040204/#dt-xml-proc">XML processor</loc> is defined by the recognition of <att>xml:id</att> attributes as defined in <specref ref="non-validating-processor"/>.</p>
			<div2 id="infoset">
				<head>XML Information Set Conformance</head>
				<p>This specification conforms to the <bibref ref="XMLIS"/>.
		The following information items <termref def="dt-must">must</termref> 
		be present in the input infosets to enable correct processing:</p>
				<ulist>
					<item>
						<p>
							<emph role="info-item">Element Information Items</emph> with
				<emph role="infoset-property">attributes</emph> property.</p>
					</item>
					<item>
						<p>
							<emph role="info-item">Attribute Information Items</emph> with
				<emph role="infoset-property">namespace name</emph>,
				<emph role="infoset-property">local name</emph> and
				<emph role="infoset-property">normalized value</emph> properties.</p>
					</item>
				</ulist>
				<p>In addition, the following properties might be present in the output infoset:</p>
				<ulist>
					<item>
						<p>
							<emph role="infoset-property">attribute type</emph> properties on <emph role="info-item">Attribute Information Items</emph>.</p>
					</item>
				</ulist>
			</div2>
		</div1>
	</body>
	<back>
		<div1 id="references">
			<head>References</head>
			<blist>
				<bibl id="RFC2119" key="IETF RFC 2119" href="http://www.ietf.org/rfc/rfc2119.txt">
					<titleref href="http://www.ietf.org/rfc/rfc2119.txt">RFC 2119: Key 
			words for use in RFCs to Indicate Requirement Levels</titleref>.
			Internet Engineering Task Force, 1997.
		</bibl>
				<bibl id="XML" key="XML 1.0" href="http://www.w3.org/TR/REC-xml">
			Tim Bray, Jean Paoli, C.M. Sperberg-McQueen, and Eve Maler, editors.
			<titleref href="http://www.w3.org/TR/REC-xml">Extensible Markup 
			Language (XML) 1.0 (Second Edition).</titleref>
			World Wide Web Consortium, 1998.
		</bibl>
				<bibl id="XMLIS" key="XML Information Set" href="http://www.w3.org/TR/xml-infoset/">
			John Cowan and Richard Tobin, editors.
			<titleref href="http://www.w3.org/TR/xml-infoset">XML Information Set (Second Edition).</titleref>
			World Wide Web Consortium, 2004.
		</bibl>
				<bibl id="XMLNS" key="Namespaces in XML" href="http://www.w3.org/TR/REC-xml-names/">
			Tim Bray, Dave Hollander, and Andrew Layman, editors.
			<titleref href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</titleref>.
			World Wide Web Consortium, 1999.
		</bibl>
			</blist>
		</div1>
		<inform-div1>
			<head>References</head>
			<blist>
				<bibl id="XMLSchemas" key="XML Schemas" href="http://www.w3.org/TR/xmlschema-1/">
			Henry S. Thompson, David Beech, Murray Maloney, Noah Mendelsohn, editors.
			<titleref href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: 
			Structures.</titleref>
			World Wide Web Consortium, 2001.
		</bibl>
			</blist>
		</inform-div1>
		<inform-div1>
			<head>Impacts on other Standards</head>
			<ulist>
				<item>
					<p>
						<emph>XPath 1.0:</emph> The id() function only recognizes IDs declared in the DTD.  An errata would be required to allow Schema-declared IDs to be included in the results of this function (enabling both the <specref ref="with-schema-validation"/> and the <specref ref="non-validating-processor"/> cases.)</p>
				</item>
				<item>
					<p>
						<emph>XPath 2.0:</emph> No change required. The id() function recognizes both DTD- and Schema-declared identifiers, and as such would also recognize <att>xml:id</att> attributes identified with a minimally conforming schema processor.</p>
				</item>
				<item>
					<p>
						<emph>XPointer Framework:</emph> No change required.  Barename fragment identifiers and the element() scheme recognize both DTD- and Schema-declared identifiers, and as such would also recognize <att>xml:id</att> attributes identified with a minimally conforming schema processor.</p>
				</item>
				<item>
					<p>
						<emph>DOM:</emph> ?</p>
				</item>
			</ulist>
		</inform-div1>
	</back>
</spec>
