Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Schema Validator not recognizing use="required"

Status
Not open for further replies.

SAFROLE

Programmer
Mar 15, 2001
5
US
I am currently experimenting with Oracle's XML Schema Validator for Java(compliant for W3C XML Schema Proposal version:20001024). I have an element definition in my schema as follows...

<xsd:element name=&quot;authorizer&quot;>
<xsd:complexType>
<xsd:attribute name=&quot;name&quot; type=&quot;xsd:string&quot; use=&quot;required&quot;/>
</xsd:complexType>
</xsd:element>

...but if I validate an XML document against this schema definition and I omit the &quot;name&quot; attribute in the &quot;authorizer&quot; element in my XML document, the parser does not complain. It should since &quot;name&quot; is required. Whats strange is that if I change the schema to use=&quot;prohibited&quot;, then the parser complains that &quot;name&quot; in the XML document should not be present since according to the schema it is prohibited(at least that makes sense). I have no clue why it does not recognize use=&quot;required&quot;. Any help would be appreciated.

SAF

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top