W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2002

RE: idL085 (Identity Constraint)

From: Priscilla Walmsley <priscilla@walmsley.com>
Date: Sat, 27 Jul 2002 10:28:35 -0400
To: "'Stanley Guan'" <stanley.guan@oracle.com>, "'Schema Interest Group'" <w3c-xml-schema-ig@w3.org>, <xmlschema-dev@w3.org>
Message-ID: <003e01c23579$e5294fc0$210a87ac@WALMSLEYPH>
Hi Stanley, 
 
I think the problem is that the constraint applies to all descendents of
myNS:root (not just its children), which includes the myNS:row elements.
The myNS:row elements do not have attributes named "col" or myNS:row
children themselves.  If the selector XPath had been "./myNS:*" (with
one slash) instead, it would be fine, because it would only apply to the
myNS:t children.  
 
Hope that helps,
Priscilla

-----------------------------------------------------
Priscilla Walmsley             priscilla@walmsley.com
Author, Definitive XML Schema     (Prentice Hall PTR)
----------------------------------------------------- 

-----Original Message-----
From: w3c-xml-schema-ig-request@w3.org
[mailto:w3c-xml-schema-ig-request@w3.org] On Behalf Of Stanley Guan
Sent: Friday, July 26, 2002 2:16 PM
To: Schema Interest Group; xmlschema-dev@w3.org
Subject: idL085 (Identity Constraint)


Hi,
 
Why the following test (i.e., idL085 - XPath Validation) on 
 
http://www.w3.org/XML/2001/05/xmlschema-test-collection/result-ms-identi
tyConstraint.htm
 
is expected to fail?
 
Can someone shed some lights on this?
 
Thx,
 
-Stanley
 
<?xml version="1.0" ?> 
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xsd#> - <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" targetNamespace="myNS.tempuri.org"
xmlns:myNS="myNS.tempuri.org" xmlns="myNS.tempuri.org">
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xsd#> - <xs:element name="root">
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xsd#> - <xs:complexType>
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xsd#> - <xs:sequence>
  <xs:element ref="t" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xsd#> - <xs:key id="foo123" name="tableu">
  <xs:selector xpath=".//myNS:*" /> 
  <xs:field xpath="@col" /> 
  <xs:field xpath="myNS:row" /> 
  </xs:key>
  </xs:element>
  <xs:element name="t" type="ttype" /> 
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xsd#> - <xs:complexType name="ttype">
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xsd#> - <xs:sequence>
  <xs:element name="row" type="xs:string" /> 
  </xs:sequence>
  <xs:attribute name="col" type="xs:string" /> 
  </xs:complexType>
  </xs:schema>
 
 

<?xml version="1.0" ?> 
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xml#> - <myNS:root
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="myNS.tempuri.org idL085.xsd"
xmlns:myNS="myNS.tempuri.org">
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xml#> - <myNS:t col="1">
  <myNS:row>1</myNS:row> 
  </myNS:t>
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xml#> - <myNS:t col="2">
  <myNS:row>2</myNS:row> 
  </myNS:t>
 
<http://www.w3.org/XML/2001/05/xmlschema-test-collection/msxsdtest/ident
ityConstraint/idL085.xml#> - <myNS:t col="2">
  <myNS:row>11</myNS:row> 
  </myNS:t>
  </myNS:root>
Received on Saturday, 27 July 2002 10:30:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:04 UTC