Q: XSD validation

Discussion in 'XML' started by Casper B, Mar 1, 2005.

  1. Casper B

    Casper B Guest

    I am switching from DTD validation to Schema due to its richness. It was
    my understanding that a Schema could be used to also specify criterias
    of elements/attributtes such that e.g. only positive integers are accepted.

    XSD:
    <xsd:element name="RowSpec">
    <xsd:complexType>
    <xsd:attribute name="Iterations" type="xsd:positiveInteger"/>
    ....

    XML:
    <RowSpec Iterations="-1">

    However, it seems my toolkit (Oracle DOM parser) is not complaining over
    the negative value above. Did I misunderstand something, are W3X types
    not part of the default validation process?

    Regards,
    Casper
     
    Casper B, Mar 1, 2005
    #1
    1. Advertising

  2. Casper B wrote:

    > I am switching from DTD validation to Schema due to its richness. It was
    > my understanding that a Schema could be used to also specify criterias
    > of elements/attributtes such that e.g. only positive integers are accepted.
    >
    > XSD:
    > <xsd:element name="RowSpec">
    > <xsd:complexType>
    > <xsd:attribute name="Iterations" type="xsd:positiveInteger"/>
    > ...
    >
    > XML:
    > <RowSpec Iterations="-1">
    >
    > However, it seems my toolkit (Oracle DOM parser) is not complaining over
    > the negative value above. Did I misunderstand something, are W3X types
    > not part of the default validation process?


    I do not use the Oracle parser but as for your schema and XML snippet,
    an error should be flagged when trying to validate that attribute value.
    But of course you need to make sure that validation against a schema is
    turned on for the parser, and that the parser finds the schema.
    If you are using Oracle only then you might find more help in an Oracle
    forum I think.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 2, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,108
    Markus
    Nov 22, 2005
  2. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    491
    C. M. Sperberg-McQueen
    Sep 26, 2003
  3. Replies:
    1
    Views:
    863
    Martin Honnen
    Jan 14, 2004
  4. Peter Aberline

    xsd:any as a child of xsd:all

    Peter Aberline, Apr 5, 2004, in forum: XML
    Replies:
    0
    Views:
    794
    Peter Aberline
    Apr 5, 2004
  5. Rushi
    Replies:
    1
    Views:
    552
Loading...

Share This Page