W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2006

Re: declaring xml:id attributes

From: George Cristian Bina <george@oxygenxml.com>
Date: Fri, 15 Sep 2006 09:53:43 +0300
Message-ID: <450A4DF7.5040702@oxygenxml.com>
To: Wolfgang Jeltsch <wolfgang@jeltsch.net>
CC: "G. Ken Holman" <gkholman@CraneSoftwrights.com>, xmlschema-dev@w3.org

Wolfgang,

In addition to wat Ken said, you may look also at
http://www.w3.org/2001/xml.xsd or
http://www.w3.org/2005/08/xml.xsd (they are the same document now)
That schema declares all the xml:* attributes. In general when I need to 
use that schema I specify the full URL in the import schemaLocation and 
then use a catalog to map that URL to a local copy.

Hope that helps,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


G. Ken Holman wrote:
> 
> At 2006-09-14 23:52 +0200, Wolfgang Jeltsch wrote:
>> I'm developing a schema in the XML Schema language and want to specify 
>> that
>> certain elements of my document type have xml:id attributes.  However, 
>> the
>> name attribute of the xsd:attribute is of type xsd:NCName but xml:id 
>> is not a
>> NCName.  How do I achieve what I want?
> 
> By importing a schema that declares this attribute.
> 
> This is what I am doing in my code list validation work:
> 
> ===========8<------------
> Vocabulary schema:
> 
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>   xmlns="urn:oasis:names:tc:ubl:schema:CodeList-Constraints-0.7"
>   targetNamespace="urn:oasis:names:tc:ubl:schema:CodeList-Constraints-0.7">
> 
> <!-- xml:id per http://www.w3.org/TR/2005/REC-xml-id-20050909/ -->
> <xsd:import schemaLocation="xmlid.xsd"
>             namespace="http://www.w3.org/XML/1998/namespace"/>
> 
> <xsd:annotation>
>  <xsd:documentation xml:lang="en">
>    A document model of the association of document contexts with the
>    URIs of expressions of enumerations of coded values.
> ...
> <!--a given code list with a unique identifier for reference in contexts-->
> <xsd:element name="CodeList">
>   <xsd:complexType>
>     <xsd:attribute ref="xml:id"/>
>     <xsd:attribute name="uri" type="xsd:anyURI"/>
>   </xsd:complexType>
> </xsd:element>
> 
> 
> ===========8<------------
> xmlid.xsd schema:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!--
>   Verbatim from http://www.w3.org/TR/2005/REC-xml-id-20050909/ section D.2
> 
>   $Id: xmlid.xsd,v 1.1 2006/06/18 16:56:30 G. Ken Holman Exp $
> -->
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>            targetNamespace="http://www.w3.org/XML/1998/namespace">
> 
>     <xs:attribute name="id" type="xs:ID"/>
> 
> </xs:schema>
> 
> 
> ===========8<------------
> 
> I hope this helps.
> 
> . . . . . . . . . . Ken
> 
> -- 
> UBL/XML/XSLT/XSL-FO training: Vårø, Denmark 2006-10-02/06,11-20/24
> UBL International 2006  2006-11-13/17 http://www.ublconference.com
> World-wide corporate, govt. & user group UBL, XSL, & XML training.
> G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
> Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
> Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
> Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/x/bc
> Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
> 
> 
> 
Received on Friday, 15 September 2006 06:50:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:55 GMT