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 Sushil <su...@mahindrabt.com> on 2003/05/06 14:25:22 UTC

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


Re: validation

Posted by Sushil <su...@mahindrabt.com>.
Thanks Doug. It worked once I set SCHEMA_FULL_CHECKING feature to true.
  ----- Original Message ----- 
  From: Doug Helton 
  To: xerces-j-user@xml.apache.org 
  Sent: Tuesday, May 06, 2003 6:33 PM
  Subject: RE: <unique> validation

     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:sushilg@mahindrabt.com]
    Sent: Tuesday, May 06, 2003 8:42 AM
    To: xerces-j-user@xml.apache.org
    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 ----- 
      From: Doug Helton 
      To: xerces-j-user@xml.apache.org 
      Sent: Tuesday, May 06, 2003 6:04 PM
      Subject: RE: <unique> validation

      What features do you have set?

      Doug
        -----Original Message-----
        From: Sushil [mailto:sushilg@mahindrabt.com]
        Sent: Tuesday, May 06, 2003 8:25 AM
        To: xerces-j-user@xml.apache.org
        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

*********************************************************
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


RE: validation

Posted by Doug Helton <dh...@ideorlando.org>.
   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:sushilg@mahindrabt.com]
  Sent: Tuesday, May 06, 2003 8:42 AM
  To: xerces-j-user@xml.apache.org
  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-schemaLo
cation", "URI of schema document is passed here");

    ----- Original Message -----
    From: Doug Helton
    To: xerces-j-user@xml.apache.org
    Sent: Tuesday, May 06, 2003 6:04 PM
    Subject: RE: <unique> validation


    What features do you have set?

    Doug
      -----Original Message-----
      From: Sushil [mailto:sushilg@mahindrabt.com]
      Sent: Tuesday, May 06, 2003 8:25 AM
      To: xerces-j-user@xml.apache.org
      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


Re: validation

Posted by Sushil <su...@mahindrabt.com>.
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 ----- 
  From: Doug Helton 
  To: xerces-j-user@xml.apache.org 
  Sent: Tuesday, May 06, 2003 6:04 PM
  Subject: RE: <unique> validation

  What features do you have set?

  Doug
    -----Original Message-----
    From: Sushil [mailto:sushilg@mahindrabt.com]
    Sent: Tuesday, May 06, 2003 8:25 AM
    To: xerces-j-user@xml.apache.org
    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


RE: validation

Posted by Doug Helton <dh...@ideorlando.org>.
What features do you have set?

Doug
  -----Original Message-----
  From: Sushil [mailto:sushilg@mahindrabt.com]
  Sent: Tuesday, May 06, 2003 8:25 AM
  To: xerces-j-user@xml.apache.org
  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