Running /Users/scantor/Documents/workspace/xerces-c/samples/SAX2Print -sa personal.xsd > "/Users/scantor/Documents/workspace/xerces-c/samples/observed/SAX2Print5.log" 2> "/Users/scantor/Documents/workspace/xerces-c/samples/observed/SAX2Print5.log" 
Result: pass
------
obs=<?xml version="1.0" encoding="LATIN1"?>
<xs:schema>

 <xs:import namespace="http://www.w3.org/XML/1998/namespace">
   <xs:annotation>
     <xs:documentation>
        The schemaLocation of the relevant file is
        "http://www.w3.org/2001/xml.xsd"; however,
        we don't want to assume people are always
        connected to the 'net when playing with this file.
     </xs:documentation>
   </xs:annotation>
 </xs:import>

 <xs:element name="personnel">
  <xs:complexType>
   <xs:sequence>
     <xs:element maxOccurs="unbounded" minOccurs="1" ref="person"></xs:element>
   </xs:sequence>
  </xs:complexType>

  <xs:unique name="unique1">
   <xs:selector xpath="person"></xs:selector>
   <xs:field xpath="name/given"></xs:field>
   <xs:field xpath="name/family"></xs:field>
  </xs:unique>
  <xs:key name="empid">
   <xs:selector xpath="person"></xs:selector>
   <xs:field xpath="@id"></xs:field>
  </xs:key>
  <xs:keyref name="keyref1" refer="empid">
   <xs:selector xpath="person"></xs:selector> 
   <xs:field xpath="link/@manager"></xs:field>  
  </xs:keyref>

 </xs:element>

 <xs:element name="person">
  <xs:complexType>
   <xs:sequence>
     <xs:element ref="name"></xs:element>
     <xs:element maxOccurs="unbounded" minOccurs="0" ref="email"></xs:element>
     <xs:element maxOccurs="unbounded" minOccurs="0" ref="url"></xs:element>
     <xs:element maxOccurs="1" minOccurs="0" ref="link"></xs:element>
   </xs:sequence>
   <xs:attribute name="id" type="xs:ID" use="required"></xs:attribute>
   <xs:attribute name="note" type="xs:string"></xs:attribute>
   <xs:attribute default="false" name="contr">
    <xs:simpleType>
     <xs:restriction base="xs:string">
       <xs:enumeration value="true"></xs:enumeration>
       <xs:enumeration value="false"></xs:enumeration>
     </xs:restriction>
    </xs:simpleType>
   </xs:attribute>
   <xs:attribute name="salary" type="xs:integer"></xs:attribute>
   <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"></xs:anyAttribute>
  </xs:complexType>
 </xs:element>

 <xs:element name="name">
  <xs:complexType>
   <xs:all>
    <xs:element ref="family"></xs:element>
    <xs:element ref="given"></xs:element>
   </xs:all>
   <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"></xs:anyAttribute>
  </xs:complexType>
 </xs:element>

 <xs:element name="family">
   <xs:complexType>
     <xs:simpleContent>
       <xs:extension base="xs:string">
          <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"></xs:anyAttribute>
        </xs:extension>
     </xs:simpleContent>
   </xs:complexType>
 </xs:element>

 <xs:element name="given">
   <xs:complexType>
     <xs:simpleContent>
       <xs:extension base="xs:string">
          <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"></xs:anyAttribute>
        </xs:extension>
     </xs:simpleContent>
   </xs:complexType>
 </xs:element>

 <xs:element name="email" type="xs:string"></xs:element>

 <xs:element name="url">
  <xs:complexType>
   <xs:attribute default="http://" name="href" type="xs:string"></xs:attribute>
  </xs:complexType>
 </xs:element>

 <xs:element name="link">
  <xs:complexType>
   <xs:attribute name="manager" type="xs:IDREF"></xs:attribute>
   <xs:attribute name="subordinates" type="xs:IDREFS"></xs:attribute>
  </xs:complexType>
 </xs:element>

 <xs:notation name="gif" public="-//APP/Photoshop/4.0" system="photoshop.exe"></xs:notation>

</xs:schema>
------
exp=<?xml version="1.0" encoding="LATIN1"?>
<xs:schema>

 <xs:import namespace="http://www.w3.org/XML/1998/namespace">
   <xs:annotation>
     <xs:documentation>
        The schemaLocation of the relevant file is
        "http://www.w3.org/2001/xml.xsd"; however,
        we don't want to assume people are always
        connected to the 'net when playing with this file.
     </xs:documentation>
   </xs:annotation>
 </xs:import>

 <xs:element name="personnel">
  <xs:complexType>
   <xs:sequence>
     <xs:element maxOccurs="unbounded" minOccurs="1" ref="person"></xs:element>
   </xs:sequence>
  </xs:complexType>

  <xs:unique name="unique1">
   <xs:selector xpath="person"></xs:selector>
   <xs:field xpath="name/given"></xs:field>
   <xs:field xpath="name/family"></xs:field>
  </xs:unique>
  <xs:key name="empid">
   <xs:selector xpath="person"></xs:selector>
   <xs:field xpath="@id"></xs:field>
  </xs:key>
  <xs:keyref name="keyref1" refer="empid">
   <xs:selector xpath="person"></xs:selector> 
   <xs:field xpath="link/@manager"></xs:field>  
  </xs:keyref>

 </xs:element>

 <xs:element name="person">
  <xs:complexType>
   <xs:sequence>
     <xs:element ref="name"></xs:element>
     <xs:element maxOccurs="unbounded" minOccurs="0" ref="email"></xs:element>
     <xs:element maxOccurs="unbounded" minOccurs="0" ref="url"></xs:element>
     <xs:element maxOccurs="1" minOccurs="0" ref="link"></xs:element>
   </xs:sequence>
   <xs:attribute name="id" type="xs:ID" use="required"></xs:attribute>
   <xs:attribute name="note" type="xs:string"></xs:attribute>
   <xs:attribute default="false" name="contr">
    <xs:simpleType>
     <xs:restriction base="xs:string">
       <xs:enumeration value="true"></xs:enumeration>
       <xs:enumeration value="false"></xs:enumeration>
     </xs:restriction>
    </xs:simpleType>
   </xs:attribute>
   <xs:attribute name="salary" type="xs:integer"></xs:attribute>
   <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"></xs:anyAttribute>
  </xs:complexType>
 </xs:element>

 <xs:element name="name">
  <xs:complexType>
   <xs:all>
    <xs:element ref="family"></xs:element>
    <xs:element ref="given"></xs:element>
   </xs:all>
   <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"></xs:anyAttribute>
  </xs:complexType>
 </xs:element>

 <xs:element name="family">
   <xs:complexType>
     <xs:simpleContent>
       <xs:extension base="xs:string">
          <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"></xs:anyAttribute>
        </xs:extension>
     </xs:simpleContent>
   </xs:complexType>
 </xs:element>

 <xs:element name="given">
   <xs:complexType>
     <xs:simpleContent>
       <xs:extension base="xs:string">
          <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"></xs:anyAttribute>
        </xs:extension>
     </xs:simpleContent>
   </xs:complexType>
 </xs:element>

 <xs:element name="email" type="xs:string"></xs:element>

 <xs:element name="url">
  <xs:complexType>
   <xs:attribute default="http://" name="href" type="xs:string"></xs:attribute>
  </xs:complexType>
 </xs:element>

 <xs:element name="link">
  <xs:complexType>
   <xs:attribute name="manager" type="xs:IDREF"></xs:attribute>
   <xs:attribute name="subordinates" type="xs:IDREFS"></xs:attribute>
  </xs:complexType>
 </xs:element>

 <xs:notation name="gif" public="-//APP/Photoshop/4.0" system="photoshop.exe"></xs:notation>

</xs:schema>
------
PASS scripts/SAX2Print5 (exit status: 0)
