Guillaume,

     I ran your schema through a tool I am one of the authors of (which you
can obtain at http://www.alphaworks.ibm.com), the XML Schema Quality
Checker.

     Here are the first few messages it produced:
|------------+--------------+---------------+------------------+--------------------------------|
|    line    |    column    |    severity   |    error type    |                
                |
|------------+--------------+---------------+------------------+--------------------------------|
|     109    |      34      |     ERROR     |    Constraint    |                
                |
|------------+--------------+---------------+------------------+--------------------------------|
                                                               |The global 
complexType          |
                                                               |referenced by 
'NameType' does   |
                                                               |not exist. 
'model:NameType'     |
                                                               |would be a 
valid reference.     |
 
------------+--------------+---------------+------------------+--------------------------------|
|     147    |      38      |     ERROR     |    Constraint    |                
                |
|------------+--------------+---------------+------------------+--------------------------------|
                                                               |The global 
complexType          |
                                                               |referenced by 
'SpecimenType'    |
                                                               |does not exist. 
                |
                                                               
|'model:SpecimenType' would be a |
                                                               |valid 
reference.                |
 
------------+--------------+---------------+------------------+--------------------------------|
|     173    |      41      |     ERROR     |    Constraint    |                
                |
|------------+--------------+---------------+------------------+--------------------------------|
                                                               |The global 
complexType          |
                                                               |referenced by 
'PublicationType' |
                                                               |does not exist. 
                |
                                                               
|'model:PublicationType' would be|
                                                               |a valid 
reference.              |
 
------------+--------------+---------------+------------------+--------------------------------|
|     188    |      41      |     ERROR     |    Constraint    |                
                |
|------------+--------------+---------------+------------------+--------------------------------|
                                                               |The global 
complexType          |
                                                               |referenced by 
'PublicationType' |
                                                               |does not exist. 
                |
                                                               
|'model:PublicationType' would be|
                                                               |a valid 
reference.              |
 
------------+--------------+---------------+------------------+--------------------------------|
|     233    |      35      |     ERROR     |    Constraint    |                
                |
|------------+--------------+---------------+------------------+--------------------------------|
                                                               |The global 
complexType          |
                                                               |referenced by 
'EventType' does  |
                                                               |not exist. 
'model:EventType'    |
                                                               |would be a 
valid reference.     |
 
------------+--------------+---------------+------------------+--------------------------------|
|     252    |      35      |     ERROR     |    Constraint    |                
                |
|------------+--------------+---------------+------------------+--------------------------------|
                                                               |The global 
complexType          |
                                                               |referenced by 
'EventType' does  |
                                                               |not exist. 
'model:EventType'    |
                                                               |would be a 
valid reference.     |
 
------------+--------------+---------------+------------------+--------------------------------|
|     265    |      35      |     ERROR     |    Constraint    |                
                |
|------------+--------------+---------------+------------------+--------------------------------|
                                                               |The global 
complexType          |
                                                               |referenced by 
'EventType' does  |
                                                               |not exist. 
'model:EventType'    |
                                                               |would be a 
valid reference.     |
                                                                
--------------------------------|



     It is so easy to make namespace errors when writing a schema that I
strongly recommend that everyone check their schema with our tool or with
XSV (or both).

          Regards,
          Bob

Bob Schloss
IBM Thomas J. Watson Research Center - Next Gen Web group
Yorktown Heights, New York USA
http://www.research.ibm.com/people/s/bschloss
http://www.research.ibm.com/XML






Guillaume Rousse <[EMAIL PROTECTED]> on 08/23/2001 11:13:52 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: xpath error



Ainsi parlait [EMAIL PROTECTED] :
> Hi Guillaume,
Hi Neil. Thanks for the reply.

> Looks like you have two choices to me:
>
> <key name="fooKey">
>   <selector xpath="model:foos/model:foo | model:foos/*/model:foo"/>
>   <field xpath="@id"/>
> </key>
>
> which should do exactly what you want but isn't perhaps as pretty as you
> might like; or
I used this solution as i have many model:foo hanging around, not only
under
model:foos element. However, this syntax seems to be badly handled by
xerces-j, and only the first proposition seems to be used.

This time with real data :
<key name="nameKey">
      <selector xpath="model:data/model:names/*/model:name |
model:data/model:names/model:name"/>
      <field xpath="@id"/>
    </key>
gives
[Error] pocilloporidae.xml:1185:11: Key with value [ID Value:  name1] not
found for identity constraint of element "dataset"

<key name="nameKey">
      <selector xpath="model:data/model:names/model:name |
model:data/model:names/*/model:name"/>
      <field xpath="@id"/>
    </key>
gives
[Error] pocilloporidae.xml:1185:11: Key with value [ID Value:  name4] not
found for identity constraint of element "dataset".[Error]
[..]
[Error] pocilloporidae.xml:1185:11: Key with value [ID Value:  name10] not
found for identity constraint of element "dataset".
[..]
[Error] pocilloporidae.xml:1185:11: Key with value [ID Value:  name15] not
found for identity constraint of element "dataset".
Etc...

name1 is toplevel, while others are deepest in name hierachy.

Full document and schema are available, if you want to check if i'm just
dumb
or if i've found a bug. I'm using a self-build xerces-j 1.4.2 /
Document is at
http://bohm.snv.jussieu.fr/~rousse/recherche/osis/model/src/xml/data/pocilloporidae.xml

Schema is at
ttp://bohm.snv.jussieu.fr/~rousse/recherche/osis/model/src/xml/schema/model.xsd

--
Guillaume Rousse <[EMAIL PROTECTED]>
GPG key http://bohm.snv.jussieu.fr/~rousse/gpgkey.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to