![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Re: declaring xml:id attributes [Thread Next] Re: declaring xml:id attributesTo: Wolfgang Jeltsch <wolfgang@-------.---> Date: 9/15/2006 12:54:00 PM 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 www.---.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 context= s--> > <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 wolfgang@j... Fri Sep 15 11:57:18 2006 Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
