private String VALIDATION = "http://xml.org/sax/features/validation";
 
    private String SCHEMA =
    "
http://apache.org/xml/features/validation/schema";
    
    private String SCHEMA_FULL_CHECKING =
    "http://apache.org/xml/features/validation/schema-full-checking";
 
    private String WARN_ON_DUPLICATE_ATTDEF =
    "http://apache.org/xml/features/validation/warn-on-duplicate-attdef";
 
    private String LOAD_EXTERNAL_DTD =
    "http://apache.org/xml/features/nonvalidating/load-external-dtd";
 
    
    // load schema\dtd
    parser.setFeature(LOAD_EXTERNAL_DTD, true);
    // turn on validation
    parser.setFeature(VALIDATION, true);
    parser.setFeature(SCHEMA, true);
    parser.setFeature(SCHEMA_FULL_CHECKING, true);
    parser.setFeature(WARN_ON_DUPLICATE_ATTDEF, true);
 
These are the features I set and unique constraints are definitely being caught.  Looks like you are missing a couple:  SCHEMA_FULL_CHECKING and WARN_ON_DUPLICATE_ATTDEF.  you may need to add LOAD_EXTERNAL_DTD  as well.
  
Doug 
 
 
 
 
al Message-----
From: Sushil [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 06, 2003 8:42 AM
To: [EMAIL PROTECTED]
Subject: Re: <unique> validation

Features set are:
 
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://apache.org/xml/features/validation/schema", true);
parser.setProperty(http://apache.org/xml/properties/schema/external-schemaLocation", "URI of schema document is passed here");
----- Original Message -----
Sent: Tuesday, May 06, 2003 6:04 PM
Subject: RE: <unique> validation

What features do you have set?
 
Doug
-----Original Message-----
From: Sushil [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 06, 2003 8:25 AM
To: [EMAIL PROTECTED]
Subject: <unique> validation

I have specified unique constraint for an element in my schema document. But, when I validate schema instance documents against this schema using Xerces 2 Java Parser 2.4, error is not shown for the same value specified for the element i.e. supposed to be unique.
 
Does anyone know whether this is a known issue or suggest something that I may be doing wrong?
 
PS XML SPY 5.0 is showing error correctly.
 
Thanks in advance,
 
Sushil

*********************************************************
Disclaimer

This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com


*********************************************************
Disclaimer

This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com

Reply via email to