Aaron Dalton | 28 Nov 2009 18:52
Picon
Favicon

Unique, key, and keyref

I have a schema (http://abstractgamers.org/xml/iago-report.xsd) that
imposes a couple of unique and key/keyref constraints.  I'm using
XML::Xerces (obviously) and have tried using both validator.pl and
validator-dom.pl included in the distribution (using --full_schema).  I
am attempting to validate an instance document
(http://abstractgamers.org/xml/iago-report-test.xml) but it refuses to
flag the duplicate "iagoid" attribute in the <player> elements.  The
Xerces documentation suggests that these constraints are supported, but
I just don't know what else to try to make that happen.  I would greatly
appreciate any help you could offer.

Many thanks,
Aaron
GlenFlint | 15 Feb 2010 23:23
Picon

Re: [Fwd: Re: Well-formed v. invalid errors] Unique, key, and keyref


Hi Aaron,
I'm having a very similar problem with key/keyref constraints.  I'm running
the free xml editor that
comes with Eclipse 3.5 no problems are being detected.  Did you ever find
out what was going on?

Here's my test xsd and xml.
*************     test.xsd       ******************
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	targetNamespace="http://www.example.org/test" 
	xmlns:tns="http://www.example.org/test"
	elementFormDefault="qualified">
	
  <xsd:complexType name="myAAA">
    <xsd:sequence minOccurs="1">
      <xsd:element name="a" minOccurs="1" maxOccurs="unbounded">
        <xsd:complexType>
          <xsd:attribute name="id" type="xsd:NCName" use="required"/>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="myBBB">
    <xsd:sequence minOccurs="1">
      <xsd:element name="b" minOccurs="1" maxOccurs="unbounded">
        <xsd:complexType>
          <xsd:attribute name="idref" type="xsd:NCName" use="required"/>
(Continue reading)


Gmane