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 "Usorov, Evgeny" <EU...@kbv.de> on 2004/07/15 11:21:22 UTC

SchemaCheck, Problem with derivation by restriction again

Hi,
 
the Xerces 2.6.2 (latest CVS version) indeed recognizes all schema-mistakes. It works only, if I has both: schema-file and XML-instance.
Are there a way to check only the schema? In some situations XML-Instance doesn't have all elementes, that are defined in the schema. 
For these elements the check fails. I tryed with class: SchemaLoader and setting the feature: "...full-schema-checking" to true. But
the SchemaLoader does not recognize my schema-mistakes. Should i write better Java-code, or SchemaLoader is not prepared to
check the schema?
 
here the example to try on your own:
 
<xs:complexType name="basis_test_typ">
    <xs:attribute name="V"/>
</xs:complexType>

and my derived type:
<xs:complexType name="derived_test_typ">
    <xs:complexContent>
          <xs:restriction base="basis_test_typ">
       <xs:sequence>
                    <xs:element name="not_allowed_element"/>
       </xs:sequence>
         </xs:restriction>
     </xs:complexContent>
</xs:complexType>

"not_allowed_element" is here wrong, and the SchemaLoader should report an error.
 
Thanks in advance
Evgeny
 

Re: SchemaCheck, Problem with derivation by restriction again

Posted by Sandy Gao <sa...@ca.ibm.com>.



There is a sample that comes with Xerces. Try

java -cp ... xni.XMLGrammarBuilder -f -a your.xsd

If you get an error here, then maybe your code isn't using SchemaLoader
correctly. You can look at this sample to see how it should be used. If you
don't get an error, then it's most likely a bug. You can report Xerces bugs
via Jira here [1].

[1] http://nagoya.apache.org/jira/browse/XERCESJ

Thanks,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: SchemaCheck, Problem with derivation by restriction again

Posted by Sandy Gao <sa...@ca.ibm.com>.



There is a sample that comes with Xerces. Try

java -cp ... xni.XMLGrammarBuilder -f -a your.xsd

If you get an error here, then maybe your code isn't using SchemaLoader
correctly. You can look at this sample to see how it should be used. If you
don't get an error, then it's most likely a bug. You can report Xerces bugs
via Jira here [1].

[1] http://nagoya.apache.org/jira/browse/XERCESJ

Thanks,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org