You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/05/24 00:22:56 UTC

DO NOT REPLY [Bug 9369] New: - parser could not catch violations to uniqueness and refernetial integrity constraints

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9369>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9369

parser could not catch violations to uniqueness and refernetial integrity constraints

           Summary: parser could not catch violations to uniqueness and
                    refernetial integrity constraints
           Product: Xerces-C++
           Version: 1.6.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Validating Parser (Schema) (Xerces 1.5 or up only)
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: halfawy@civil.ubc.ca


I used the parser on a simple schema that has a uniqueness and referntial 
integrity constraints. the parser did not report error while parsing an 
invalid instance file. below is the sample I used:
<?xml version="1.0" encoding="utf-8"?>
<!-- databaseSchema2.xsd -->
<xs:schema targetNamespace="MH" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:mh="MH" elementFormDefault="qualified" version="1.0">
	<xs:element name="manufacturer" type="mh:manufacturerType">
		<xs:unique name="orderKey">
			<xs:selector xpath="manufacturer/order"/>
			<xs:field xpath="@orderID"/>
		</xs:unique>
		<xs:keyref name="orderFK" refer="mh:orderKey">
			<xs:selector xpath="manufacturer/part/orderPart"/>
			<xs:field xpath="orderID"/>
		</xs:keyref>
	</xs:element>
	<xs:complexType name="manufacturerType">
		<xs:sequence>
			<xs:element name="manufacturerName" type="xs:string"/>
			<xs:element name="part" type="mh:partType" 
maxOccurs="unbounded"/>
			<xs:element name="order" type="mh:orderType" 
maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="partType">
		<xs:sequence>
			<xs:element name="description" type="mh:description"/>
			<xs:element name="orderPart" type="mh:orderPartType" 
maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="partID" type="xs:integer"/>
	</xs:complexType>
	<xs:complexType name="orderType">
		<xs:sequence>
			<xs:element name="orderDate" type="xs:string"/>
		</xs:sequence>
		<xs:attribute name="orderID" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="orderPartType">
		<xs:sequence>
			<xs:element name="orderID" type="xs:string"/>
			<xs:element name="quantity" type="mh:quantity"/>
			<xs:element name="price" type="mh:dollarAmount"/>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="description">
		<xs:restriction base="xs:string">
			<xs:maxLength value="100"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="dollarAmount">
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="12"/>
			<xs:fractionDigits value="2"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="quantity">
		<xs:restriction base="xs:integer">
			<xs:totalDigits value="3"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="entityName">
		<xs:restriction base="xs:string">
			<xs:maxLength value="50"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>



----------

<?xml version="1.0" encoding="utf-8"?>
<!-- databaseSchema2.xml -->
<manufacturer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="MH" 
xsi:schemaLocation="MH databaseSchema.xsd">
	<manufacturerName>Mahmoud's Widgets</manufacturerName>
	<part partID="20178">
		<description>3 in. widgets</description>
		<orderPart>
			<orderID>1765</orderID>
			<quantity>7</quantity>
			<price>0.20</price>
		</orderPart>
		<orderPart>
			<orderID>"1899"</orderID>
			<quantity>12</quantity>
			<price>0.20</price>
		</orderPart>
	</part>
	<part partID="18273">
		<description>2 in. grommets</description>
		<orderPart>
			<orderID>"1762"</orderID>
			<quantity>11</quantity>
			<price>0.50</price>
		</orderPart>
	</part>
	<part partID="26334">
		<description>1 in. flanges</description>
		<orderPart>
			<orderID>"9999"</orderID>
			<quantity>20</quantity>
			<price>0.15</price>
		</orderPart>
	</part>
	<!-- Orders -->
	<order orderID="1762">
		<orderDate>5/17/2001</orderDate>
	</order>
	<order orderID="1899">
		<orderDate>5/22/2001</orderDate>
	</order>
	<order orderID="1899">
		<orderDate>5/22/2002</orderDate>
	</order>
</manufacturer>


---

thanks for any help.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org