<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE article [
<!-- ELEMENT declarations work around MSXML bug. -->
<!ELEMENT section ANY>
<!ATTLIST section id ID #IMPLIED>
<!ELEMENT appendix ANY>
<!ATTLIST appendix id ID #IMPLIED>
<!ELEMENT bibliomixed ANY>
<!ATTLIST bibliomixed id ID #IMPLIED>
]>
<article status="Working Draft">
<articleinfo>
<releaseinfo>$Id: xsd.xml,v 1.1 2001/09/03 08:06:05 jjc Exp $</releaseinfo>
<title>Guidelines for using W3C XML Schema Datatypes with RELAX NG</title>
<authorgroup>
<editor>
  <firstname>James</firstname><surname>Clark</surname>
  <affiliation>
    <address><email>jjc@jclark.com</email></address>
  </affiliation>
</editor>
<editor>
  <surname>KAWAGUCHI</surname><firstname>Kohsuke</firstname>
  <affiliation>
    <address><email>kohsuke.kawaguchi@sun.com</email></address>
  </affiliation>
</editor>
</authorgroup>
<pubdate>3 September 2001</pubdate>
<releaseinfo role="meta">
$Id: xsd.xml,v 1.1 2001/09/03 08:06:05 jjc Exp $
</releaseinfo>

<copyright><year>2001</year><holder>OASIS</holder></copyright>

<legalnotice>

<para>Copyright &#169; The Organization for the Advancement of
Structured Information Standards [OASIS] 2001. All Rights
Reserved.</para>

<para>This document and translations of it may be copied and furnished
to others, and derivative works that comment on or otherwise explain
it or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any kind,
provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to OASIS, except as needed for the
purpose of developing OASIS specifications, in which case the
procedures for copyrights defined in the OASIS Intellectual Property
Rights document must be followed, or as required to translate it into
languages other than English.</para>

<para>The limited permissions granted above are perpetual and will not
be revoked by OASIS or its successors or assigns.</para>

<para>This document and the information contained herein is provided
on an <quote>AS IS</quote> basis and OASIS DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE
USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY
IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE.</para>

</legalnotice>

<legalnotice role="status"><title>Status of this Document</title>

<para>This is a working draft constructed by the editors. It is not an
official committee work product and may not reflect the consensus
opinion of the committee.  Comments on this document may be sent to
<ulink url="mailto:relax-ng-comment@lists.oasis-open.org"
>relax-ng-comment@lists.oasis-open.org</ulink>.</para>

<!--
<para>This working draft was approved for publication by the OASIS
RELAX NG technical committee. It represents the current consensus of
the committee.  However, it is a draft document and further changes
are still possible.  Comments on this document may be sent to <ulink
url="mailto:relax-ng-comment@lists.oasis-open.org"
>relax-ng-comment@lists.oasis-open.org</ulink>.</para>
-->

</legalnotice>

<abstract>
<para>This document specifies guidelines for using the datatypes
defined by <xref linkend="xmlschema-2"/> with <xref
linkend="spec"/>.</para>

</abstract>

<revhistory>
<revision>
  <revnumber>Working Draft</revnumber>
  <date>3 September 2001</date>
</revision>
</revhistory>
</articleinfo>

<section>
<title>Introduction</title>

<para>This document specifies guidelines for using the datatypes
defined by <xref linkend="xmlschema-2"/> as a datatype library for
<xref linkend="spec"/>.  The URI</para>

<programlisting>http://www.w3.org/2001/XMLSchema-datatypes</programlisting>

<para>should be used to identify the datatype library.  The library
identified by this URI contains all the builtin datatypes of <xref
linkend="xmlschema-2"/>, both primitive and derived.</para>

</section>

<section>
<title>Parameters</title>

<para>Any facet can be specified as a parameter with the following
exceptions</para>

<itemizedlist>

<listitem><para><literal>whiteSpace</literal> (the builtin derived
datatype that specifies the desired value for the
<literal>whiteSpace</literal> facet should be used
instead)</para></listitem>

<listitem><para><literal>enumeration</literal> (the
<literal>value</literal> element should be used
instead)</para></listitem>

</itemizedlist>

<para>If the <literal>pattern</literal> parameter is specified more
than once for a single <literal>data</literal> element, then a string
matches the <literal>data</literal> element only if it matches all of
the patterns.  It is an error to specify a parameter other than
<literal>pattern</literal> more than once for a single
<literal>data</literal> element.</para>

</section>

<section>
<title><literal>NOTATION</literal> datatype</title>

<para>The relationship between the <literal>NOTATION</literal>
datatype of <xref linkend="xmlschema-2"/> and the
<literal>NOTATION</literal> datatype of <xref linkend="xml-rec"/> is
different from the relationship between the <literal>ENTITY</literal>
datatype of <xref linkend="xmlschema-2"/> and the
<literal>ENTITY</literal> datatype of <xref linkend="xml-rec"/>.
Whereas values of the <literal>ENTITY</literal> datatype of <xref
linkend="xmlschema-2"/> refer to entities declared in the DTD of
document being validated, values of the <literal>NOTATION</literal>
datatype of <xref linkend="xmlschema-2"/> refer to notations declared
in the XML Schema.  This makes it problematic to use the
<literal>NOTATION</literal> datatype outside the context of XML Schema
Part 1. However, since <xref linkend="xmlschema-2"/> does not allow a
schema to use the <literal>NOTATION</literal> datatype directly, but
requires that a value be specified for the
<literal>enumeration</literal> facet, and since the values of the
<literal>NOTATION</literal> datatype are QNames, the
<literal>NOTATION</literal> datatype is, considering just validation,
effectively equivalent to the <literal>QName</literal> datatype. It is
therefore recommended that RELAX NG validators implement the same
validation semantics for the <literal>NOTATION</literal> datatype as
for the <literal>QName</literal> datatype.</para>

</section>

<section>
<title><literal>ID</literal>, <literal>IDREF</literal> and
<literal>IDREFS</literal> datatypes</title>

<para>The semantics defined by <xref linkend="xmlschema-2"/> for the
<literal>ID</literal>, <literal>IDREF</literal> and
<literal>IDREFS</literal> datatypes are purely lexical and do not
include the cross-reference semantics of the corresponding <xref
linkend="xml-rec"/> datatypes.  The cross-reference semantics of these
datatypes in XML Schema comes from XML Schema Part 1.  Furthermore,
the <xref linkend="xml-rec"/> cross-reference semantics of these
datatypes do not fit into the RELAX NG model of what a datatype is.
Therefore, RELAX NG validation will only validate the lexical aspects
of these datatypes as defined in <xref linkend="xmlschema-2"/>.</para>

<para>However, <xref linkend="compatibility"/> defines a compatibility
datatype library containing <literal>ID</literal>,
<literal>IDREF</literal> and <literal>IDREFS</literal> datatypes and
defines special processing for these datatypes that implements the
<xref linkend="xml-rec"/> cross-reference semantics.  An
implementation of <xref linkend="compatibility"/> should treat the
<literal>ID</literal>, <literal>IDREF</literal> and
<literal>IDREFS</literal> datatypes of <xref linkend="xmlschema-2"/>
as being aliases for the corresponding DTD compatibility datatypes for
the purposes of the processing defined in <xref
linkend="compatibility"/> (i.e. for determining compatibility and
soundness, and modifying the infoset).</para>

</section>

<bibliography><title>References</title>

<bibliomixed id="xml-rec"><abbrev>XML 1.0</abbrev>Tim Bray,
Jean Paoli, and
C. M. Sperberg-McQueen, Eve Maler, editors.
<citetitle><ulink url="http://www.w3.org/TR/REC-xml">Extensible Markup
Language (XML) 1.0 Second Edition</ulink></citetitle>.
W3C (World Wide Web Consortium), 2000.</bibliomixed>

<bibliomixed id="spec"><abbrev>RELAX NG</abbrev>James Clark, Makoto
MURATA, editors.  <citetitle><ulink
url="http://www.oasis-open.org/committees/relax-ng/spec.html">RELAX NG
Specification</ulink></citetitle>.  OASIS, 2001.</bibliomixed>

<bibliomixed id="compatibility"><abbrev>DTD
Compatibility</abbrev>James Clark, Makoto MURATA, editors.
<citetitle><ulink
url="http://www.oasis-open.org/committees/relax-ng/compatibility.html">RELAX
NG DTD Compatibility</ulink></citetitle>.  OASIS, 2001.</bibliomixed>

<bibliomixed id="xmlschema-2"><abbrev>W3C XML Schema Datatypes</abbrev>Paul V. Biron, Ashok Malhotra, editors.
<citetitle><ulink url="http://www.w3.org/TR/xmlschema-2/">XML Schema Part 2: Datatypes</ulink></citetitle>.
W3C (World Wide Web Consortium), 2001.</bibliomixed>

</bibliography>

</article>
