Hi Vamsi ,
I believe problem is that you have specified minInclusive value as 1 and pattern value as d{2} (i.e 2 digits ). Either change
your pattern value or make minInclu..... as 01 .
<xs:minInclusive value = "1"/>
<xs:maxInclusive value = "12"/>
<xs:pattern value = "\d{2}"/>Hope this helps
Regards Venu
Vamsi Atluri wrote:
Hello all,
I am having a problem when I try to validate XML data against an XSD file. Previously I was having problems where the parser would not even invoke the XSD file, but I got over those by setting the parser properties as below:
TestErrorHandler errorHandler = new TestErrorHandler();
DOMParser parser = new org.apache.xerces.parsers.DOMParser();
parser.setEntityResolver(new TestEntityResolver());
parser.setErrorHandler(errorHandler);
parser.setFeature("http://xml.org/sax/features/validation", false); parser.setFeature("http://xml.org/sax/features/namespaces", false); parser.setFeature("http://apache.org/xml/features/validation/schema", true); parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whitespace", false); parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", "TestSchema.xsd");
However, when I am running this, I am getting the following error:
FacetValueFromBase: Value '1' of facet 'minInclusive' must be from the value space of the base type.
The error was pointing to the XSD file, and I looked up the line number printed out by my error handler, and it turned out to be this definition in the XSD file:
<xs:simpleType name = "MonthType"> <xs:restriction base = "xs:integer"> <xs:minInclusive value = "1"/> <xs:maxInclusive value = "12"/> <xs:pattern value = "\d{2}"/> <xs:whiteSpace value = "collapse"/> </xs:restriction> </xs:simpleType>
So, to me, it looks like the parser for some reason does not like the
minInclusive declaration. I don't know what I need to do here to rectify
this.
Any help in solving this problem will be greatly appreciated.
Regards, -Vamsi
__________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
