W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2001

Re: New XSV release

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Tue, 10 Jul 2001 19:27:47 +0200
Message-ID: <3B4B3B13.E4014717@dyomedea.com>
To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>, xmlschema-dev@w3.org
Hi Henry,

"Henry S. Thompson" wrote:
> XSV 1.197/1.99 of 2001/07/06 10:02:16 is now available in all forms
> (executable, web server, sources) -- fixes the bug that started this
> thread, does a better job with attribute defaults.

The new release doesn't seem to support the conclusions we've reached in
the discussion about key and keyrefs [1].

[1] http://lists.w3.org/Archives/Public/xmlschema-dev/2001Jul/0003.html

If we take the following document:

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <key id="1"/>
    <key id="2"/>
    <key id="3"/>
    <ref ref="1"/>
    <ref ref="2"/>
    <ref ref="3"/>

The schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  <xs:element name="root">
        <xs:element name="keys">
              <xs:element name="key" maxOccurs="unbounded">
                  <xs:attribute name="id" type="xs:byte"
          <xs:key name="key">
            <xs:selector xpath="key"/>
            <xs:field xpath="@id"/>
        <xs:element name="refs">
              <xs:element name="ref" maxOccurs="unbounded">
                  <xs:attribute name="ref" type="xs:byte"
    <!--<xs:key name="key">
      <xs:selector xpath="keys/key"/>
      <xs:field xpath="@id"/>
    <xs:keyref name="keyref" refer="key">
      <xs:selector xpath="refs/ref"/>
      <xs:field xpath="@ref"/>

fails with the following error:

<?xml version='1.0'?>
<xsv docElt='{None}root' instanceAssessed='true' instanceErrors='1'
nonymous]' schemaErrors='0' schemaLocs='None -> keys-refs.xsd'
validation='strict' version='XSV 1.197/1.99 of 2001/07/06 10:02:16'
<importAttempt URI='keys-refs.xsd' outcome='success'/>
<invalid char='39' code='cvc-identity-constraint.2.3.2' line='1'
keys-refs.xml'>No key or unique constraint named key declared, refed by
keyref keyref</invalid>

My new undertanding was that the key could be defined under /root/keys
and its definition would be propagated to its parent /root where it can
be referenced...

Note that if I uncomment the definition of the key under /root, the
validation succeeds.

Have I missed something or is-it a bug in XSV?



> ht
> --
>   Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
>           W3C Fellow 1999--2001, part-time member of W3C Team
>      2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
>             Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
>                      URL: http://www.ltg.ed.ac.uk/~ht/

See you at XTech in San Diego.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
Received on Tuesday, 10 July 2001 13:27:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC