http://www.xmlforasp.net/schemavalidator.aspx
http://www.zvon.org/xxl/XMLSchemaTutorial/Output/ser_over_st0.html
We can override the schema declaration when setting xsi:nil attribute to value "true". The schema must allow this by setting attribute "nillable" to "true" (default value is "false").
Valid document
<root
xsi:noNamespaceSchemaLocation="correct_0.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <e1>xxx</e1> </root> Valid document
<root
xsi:noNamespaceSchemaLocation="correct_0.xsd" xsi:nil="true" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> Invalid document
<root
xsi:noNamespaceSchemaLocation="correct_0.xsd" xsi:nil="true" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <e1>xxx</e1> </root> Invalid document
<root
xsi:noNamespaceSchemaLocation="correct_0.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> |
Correct XML Schema (correct_0.xsd)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> <xsd:element |
2. Relax NG
There is no such mechanism in Relax NG.