Hello,
I am using BaseX 11.0 beta build 587d1ca and Xerces 2.12.2 for the XSD 1.1
validation.
It looks like that validate:xsd-report() call is not emitting warnings.
Though Oxygen XML IDE shows the following upon validation:
For simpleType definition '#AnonType_ADDR_TYPE', the enumeration value ''
contradicts with value of 'length' facet.
Warning.xq
===========
declare variable $xml as xs:string external;
declare variable $xsd as xs:string external;
let $result := validate:xsd-report($xml, $xsd, map {
'http://apache.org/xml/features/validation/cta-full-xpath-checking': true(),
'cache': false() })
return $result
It returns the following:
<report>
<status>valid</status>
</report>
But it should be as follow:
<report>
<status>valid</status>
<message level="Warning" line="..." column="..." url="...">Warning
message</message>
</report>
XML/XSD pair to reproduce the behavior.
Warning.xml
============
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Warning.xsd">
<ADDR_TYPE>B</ADDR_TYPE>
</root>
Warning.xsd
============
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element ref="ADDR_TYPE"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ADDR_TYPE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="1"/>
<xs:enumeration value="">
<xs:annotation>
<xs:documentation>NOT SELECTED</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="B"/>
<xs:enumeration value="S"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:schema>
Regards,
Yitzhak Khabinsky