O
Oskar Stuffer
Hi!
I'm using the msv tool which uses xerces to validate a XML document against a
XML Schema
definition.
This is my XML Schema definition:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="AnnoMeseCIG">
<xs:simpleType>
<xs:restriction base="xs:gYearMonth">
<xs:minInclusive value="2005-01"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:schema>
Parsing this schema an exception is thrown:
Exception in thread "main" java.lang.ClassCastException
at com.sun.msv.datatype.xsd.TypeIncubator.derive(TypeIncubator.java:216)
at
com.sun.msv.reader.datatype.xsd.XSDatatypeExp$1.derive(XSDatatypeExp.java:92)
at
com.sun.msv.reader.datatype.xsd.RestrictionState.annealType(RestrictionState.java:41)
at
com.sun.msv.reader.datatype.xsd.TypeWithOneChildState.makeType(TypeWithOneChildState.java:42)
at com.sun.msv.reader.datatype.xsd.TypeState._makeType(TypeState.java:76)
at com.sun.msv.reader.datatype.xsd.TypeState.endSelf(TypeState.java:52)
at com.sun.msv.reader.SimpleState.endElement(SimpleState.java:100)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:595)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
...
I tried some online validators that use xerces and they had the same problem
with my schema.
Is there a bug in xerces or is something wrong with my XML Schema definition?
Thanks for your help
Oskar Stuffer
I'm using the msv tool which uses xerces to validate a XML document against a
XML Schema
definition.
This is my XML Schema definition:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="AnnoMeseCIG">
<xs:simpleType>
<xs:restriction base="xs:gYearMonth">
<xs:minInclusive value="2005-01"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:schema>
Parsing this schema an exception is thrown:
Exception in thread "main" java.lang.ClassCastException
at com.sun.msv.datatype.xsd.TypeIncubator.derive(TypeIncubator.java:216)
at
com.sun.msv.reader.datatype.xsd.XSDatatypeExp$1.derive(XSDatatypeExp.java:92)
at
com.sun.msv.reader.datatype.xsd.RestrictionState.annealType(RestrictionState.java:41)
at
com.sun.msv.reader.datatype.xsd.TypeWithOneChildState.makeType(TypeWithOneChildState.java:42)
at com.sun.msv.reader.datatype.xsd.TypeState._makeType(TypeState.java:76)
at com.sun.msv.reader.datatype.xsd.TypeState.endSelf(TypeState.java:52)
at com.sun.msv.reader.SimpleState.endElement(SimpleState.java:100)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:595)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
...
I tried some online validators that use xerces and they had the same problem
with my schema.
Is there a bug in xerces or is something wrong with my XML Schema definition?
Thanks for your help
Oskar Stuffer