[erlang-questions] Problem with XML validation using xmerl_xsd:validate().

Андрей Сединин sedinin@REDACTED
Fri Dec 26 00:47:44 CET 2008


Please help to sort it out:

trying to validate XML using:

     {ok, State } = xmerl_xsd:process_schema("test.xsd"),
     {Entity ,_} = xmerl_scan:file("test.xml"),
     xmerl_xsd:validate(Entity, State).

XSD content:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="status">
				<xs:extension base="status-type"/>
	<xs:simpleType name="status-type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Valid" />
			<xs:enumeration value="Invalid" />
			<xs:enumeration value="" />
and receive next error:

XML content:

<?xml version="1.0" encoding="UTF-8"?>

Got an error:


I think it is valid markup for this schema. The same opinion has some  
other validating parsers.

How do you think?


More information about the erlang-questions mailing list