You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Bob Schloss <rs...@us.ibm.com> on 2001/10/25 23:42:23 UTC

Re: Schemas Identity Constraint -- does it break a schema IDE validation rule

If you are not sure if something is a legal schema, or you do not
understand something in the W3C Schema specifications, I would recommend
posting to xmlschema-dev@w3.org, where some of the members of the W3C XML
Schema working group read and respond to posts, and many of the people who
are writing schema tools or have built complex schema also participate.
However, before doing so, it is a good idea to run your schema through XSV
(http://www.w3.org/2001/03/webdata/xsv).  (I just did this and XSV thinks
the schema you gave is okay).

(I will also be eager to read the response from some in the Xerces
developer group who may tell you why Xerces behaves as it does).

Bob




Joan Pujol <jo...@ima.udg.es> on 10/25/2001 03:17:26 AM

Please respond to xerces-j-user@xml.apache.org

To:   xerces-j-user@xml.apache.org
cc:
Subject:  Schemas Identity Constraint



Hi,

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
apply.
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"
xsi:noNamespaceSchemaLocation="testfile.xsd">
     <Element name="NAME1"/>
     <Element name="NAME1"/>
</Root>


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

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


Bye,

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





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