Q: XSD validation

C

Casper B

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
 
M

Martin Honnen

Casper said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top