W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Schemas Identity Constraint

From: Joan Pujol <joan.pujol@ima.udg.es>
Date: Fri, 26 Oct 2001 09:44:51 +0200
Message-ID: <3BD91473.676CA21E@ima.udg.es>
To: xmlschema-dev@w3.org

I have problems with Schema's Identity Contraints.
I can't understand the behaivor of some Xpath expressions on selectors.

For example, if I use ".//*" as the selector, the constraint aparently don't
And if I use the "*" that is a subcase of ".//*" the contraint is applied.

I readed a little at the Schema Specification(3.11.6), and ".//*" is a well
constructed XPath expresion for a selector.
I think that the problem is that it break one of the Indentity-constraint
Definition Validation Rules (3.11.4), but I can't find which rule.

Someone can help me?

This are my test files:

<?xml version="1.0" encoding="UTF-8"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	<Element name="NAME1"/>
    	<Element name="NAME1"/>

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
	<element name="Root">
			<choice minOccurs="0" maxOccurs="unbounded">
				<element name="Element">
					<attribute name="name"/>
		<unique name="IdentityContraint1">
		    <selector xpath=".//*"/>
		    <field xpath="@name"/>

Parsing the XML file returns that this is OK (aparently ignoring the Identity
If I change the selector for "*" the parser informs of the identity constraint

Received on Friday, 26 October 2001 03:45:08 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:53 UTC