Re: New XSV release

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"
xsi:noNamespaceSchemaLocation="keys-refs.xsd">
  <keys>
    <key id="1"/>
    <key id="2"/>
    <key id="3"/>
  </keys>
  <refs>
    <ref ref="1"/>
    <ref ref="2"/>
    <ref ref="3"/>
  </refs>
</root>

The schema:

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

fails with the following error:

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

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?

Thanks

Eric

 
> 
> 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.
             http://conferences.oreillynet.com/cs/os2001/view/e_spkr/790
------------------------------------------------------------------------
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