|
I think your problem lies in the fact that keyref
"TotalFundForAttachedKeyPersonsExistKeyRef2" doesn't in fact refer to key
"TotalFundForAttachedKeyPersonsExistKey" as you seem to be thinking, but to
"TotalFundForAttacheKeyPersonsExistKey2", so it looks for the
element "AttachedKeyPersons", which is in
fact missing....
Radu
I want to clarify one item in the email
below: The 'validation error' comes from calling:
org.apache.xmlbeans.XmlObject.validate().
We call this routine all over in our code, it is
great for debugging. This is the first time
we've been totally stumped.
----- Original Message -----
Sent: Tuesday, November 22, 2005 3:09
PM
Subject: Key 'Yes' not found for keyref
constraint ...
I'm getting a validation error on the XML
generated for the schema snippet below:
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>
. . .
<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>
<xs:simpleType name="YesNoDataType"> <xs:restriction
base="xs:string"> <xs:enumeration
value="Yes"/> <xs:enumeration
value="No"/>
</xs:restriction> </xs:simpleType>
|