You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Samuel B. Quiring" <sb...@Cayuse.com> on 2005/11/23 00:09:57 UTC

Key 'Yes' not found for keyref constraint ...

I'm getting a validation error on the XML generated for the schema snippet below:

validationError: error: cvc-identity-constraint.4.3: Key 'Yes' not found for keyref constraint 'TotalFundForAttachedKeyPersonsExistKeyRef2@http://apply.grants.gov/forms/RR_Budget-V1.0'

Does anyone have any idea what this means?  I've been trying to figure this out for a couple of hours.  Here is the relevant XML that is generated:

--------------------------------------------------------------------------------

          <rr:FundsRequested>40</rr:FundsRequested>
          <rr:BaseSalary>90</rr:BaseSalary>
      </rr:Compensation>
  </rr:KeyPerson>
  <rr:TotalFundForAttachedKeyPersons rr:TotalFundForAttachedKeyPersonsExist="Yes">101</rr:TotalFundForAttachedKeyPersons>
  <rr:TotalFundForKeyPersons>51</rr:TotalFundForKeyPersons>
</rr:KeyPersons>

--------------------------------------------------------------------------------


Schema Snippet (http://apply.grants.gov/forms/schemas/RR_Budget-V1.0.xsd)
 <xs:schema xmlns:RR_Budget="http://apply.grants.gov/forms/RR_Budget-V1.0"
     xmlns:att="http://apply.grants.gov/system/Attachments-V1.0"
     xmlns:globLib="http://apply.grants.gov/system/GlobalLibrary-V1.0" 
     . . .
<xs:import namespace="http://apply.grants.gov/system/Global-V1.0"
    schemaLocation="http://apply.grants.gov/system/schemas/Global-V1.0.xsd" /> 
     . . .
<xs:element name="KeyPersons">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="KeyPerson" type="RR_Budget:KeyPersonDataType" maxOccurs="8"/>
            <xs:element name="TotalFundForAttachedKeyPersons" minOccurs="0">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="glob:DecimalMin1Max15Places2Type">
                            <xs:attribute name="TotalFundForAttachedKeyPersonsExist" type="globLib:YesNoDataType" use="required" fixed="Yes"/>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="TotalFundForKeyPersons" type="glob:DecimalMin1Max15Places2Type"/>
            <xs:element name="AttachedKeyPersons" minOccurs="0">
                <xs:complexType>
                    <xs:complexContent>
                        <xs:extension base="att:AttachedFileDataType">
                            <xs:attribute name="TotalFundForAttachedKeyPersonsExist" type="globLib:YesNoDataType" use="required" fixed="Yes"/>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:key name="TotalFundForAttachedKeyPersonsExistKey">
        <xs:selector xpath="./RR_Budget:TotalFundForAttachedKeyPersons"/>
        <xs:field xpath="@RR_Budget:TotalFundForAttachedKeyPersonsExist"/>
    </xs:key>
    <xs:keyref name="TotalFundForAttachedKeyPersonsExistKeyRef" refer="RR_Budget:TotalFundForAttachedKeyPersonsExistKey">
        <xs:selector xpath="./RR_Budget:AttachedKeyPersons"/>
        <xs:field xpath="@RR_Budget:TotalFundForAttachedKeyPersonsExist"/>
    </xs:keyref>
    <xs:key name="TotalFundForAttachedKeyPersonsExistKey2">
        <xs:selector xpath="./RR_Budget:AttachedKeyPersons"/>
        <xs:field xpath="@RR_Budget:TotalFundForAttachedKeyPersonsExist"/>
    </xs:key>
    <xs:keyref name="TotalFundForAttachedKeyPersonsExistKeyRef2" refer="RR_Budget:TotalFundForAttachedKeyPersonsExistKey2">
        <xs:selector xpath="./RR_Budget:TotalFundForAttachedKeyPersons"/>
        <xs:field xpath="@RR_Budget:TotalFundForAttachedKeyPersonsExist"/>
    </xs:keyref>
</xs:element>

>From globLib (http://apply.grants.gov/system/schemas/Global-V1.0.xsd)
<xs:simpleType name="YesNoDataType">
   <xs:restriction base="xs:string">
      <xs:enumeration value="Yes"/>
      <xs:enumeration value="No"/>
   </xs:restriction>
</xs:simpleType>