Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: declaring xml:id attributes

From: "G. Ken Holman" <gkholman@----------------.--->
To: xmlschema-dev@--.---
Date: 9/14/2006 6:10:00 PM
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=E5r=F8, 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@C...
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



From george@o... Fri Sep 15 06:50:55 2006
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.o


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent