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 Inga Schuetz <sc...@darmstadt.gmd.de> on 2001/03/28 12:20:15 UTC
Problems with constrainig facets
Hallo!
I think the following XML-Code should cause an error during validated
parsing. The value of UserName is below the minInclusive Value of the
schema. I don't get any error message.
The features of the parser are set like this
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://apache.org/xml/features/validation/schema", true);
parser.setFeature("http://xml.org/sax/features/namespaces", true);
The XML-file
<?xml version="1.0" encoding="UTF-8"?>
<Person xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="D:\USERS\schuetz\XML\facet1.xsd">
<UserName>25</UserName>
</Person>
The XML-Schema
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="Person" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="UserName" type="userName"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="userName">
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="100"/>
<xsd:maxInclusive value="1000"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Thanks, for your help
Inga
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org