Skip to main content

alphaWorks  >  Forums  >  XML Schema Quality Checker  >  developerWorks

sqc does not find keyref in non global element    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
Permlink Replies: 1 - Pages: 1 - Last Post: Dec 12, 2005 10:34 AM Last Post By: Threads: [ Previous | Next ]

Posts: 2
Registered: Dec 12, 2005 10:28:29 AM
sqc does not find keyref in non global element
Posted: Dec 12, 2005 10:32:07 AM
Click to report abuse...   Click to reply to this thread Reply
sqc reports key not found on valid schema,
It seems to me that when the constraint and the key are not in global element it does not find them

error report

ERROR
file = file:C:/schemas/jdbc/Untitled7.xsd line 16 column 45
SEVERITY: 1
ERROR TYPE: 2
MESSAGE
Identity constraint (Key or Unique) http://y.y.z:key is not found.


<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 sp1 U (http://www.altova.com) by Mike Skells (Dept of Social Community & Family Affairs) -->
<xs:schema xmlns:local="http://y.y.z" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://y.y.z" elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:complexType name="root-type">
<xs:sequence>
<xs:element name="child">
<xs:complexType>
<xs:sequence>
<xs:element name="sub">
<xs:complexType>
<xs:attribute name="sub-id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:keyref name="ref" refer="local:key">
<xs:selector xpath="sub"/>
<xs:field xpath="@sub-id"/>
</xs:keyref>
<xs:key name="key">
<xs:selector xpath="sub"/>
<xs:field xpath="@sub-id"/>
</xs:key>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="ok">
<xs:complexType>
<xs:sequence>
<xs:element name="sub">
<xs:complexType>
<xs:attribute name="sub-id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:key name="key2">
<xs:selector xpath="sub"/>
<xs:field xpath="@sub-id"/>
</xs:key>
<xs:keyref name="ref2" refer="local:key2">
<xs:selector xpath="sub"/>
<xs:field xpath="@sub-id"/>
</xs:keyref>
</xs:element>
</xs:schema>

Posts: 2
Registered: Dec 12, 2005 10:28:29 AM
Re: sqc does not find keyref in non global element
Posted: Dec 12, 2005 10:34:19 AM   in response to: in response to: 's post
Click to report abuse...   Click to reply to this thread Reply
note schema can be viewed if you reply and include original message

Point your RSS reader here for a feed of the latest messages in all forums