[relaxng-user] relaxNG schema for W3C schema

MURATA Makoto (FAMILY Given) EB2M-MRT at asahi-net.or.jp
Mon Sep 13 22:46:52 ICT 2004


On Thu, 19 Aug 2004 11:23:01 +0200
"CAUBEL, Hugues" <hugues.caubel at airbus.com> wrote:

> xmlschema.rng:718:18: error: conflicting ID-types for attribute "id" of element 
>"include" from namespace " http://www.w3.org/2001/XMLSchema"

This error happens when (1) some attribute declaration has a wildcard matching 
absolutely any namespace and (2) you have an ID attribute somewhere else in your schema.

There are two solutions.  One is to make the wildcard match all namespaces EXCEPT 
the namespace of the element declaration having that ID attribute.    The other is 
to convert the ID attribute to a string attribute.

In your case, I would rewrite <element><anyName/>...</element> with 
<element><anyName><except><nsName ns="http://www.w3.org/2001/XMLSchema"/>
</except></anyName>.

A fundamendal reasons is as follows.  In DTD, an application program can determine 
whether an attribute is ID by examining the attribute name and the parent element name.  
The DTD Compatibility specification of RELAX NG is intended to mimic DTDs and  
ensures this simplicity.

Hope this helps.

Cheers,
-- 
MURATA Makoto (FAMILY Given) <EB2M-MRT at asahi-net.or.jp>




More information about the relaxng-user mailing list