For xs:boolean With Fixed Attribute, Validation Generates LSX-00205 (Doc ID 1103951.1)

Last updated on MAY 18, 2010

Applies to:

Oracle Server - Enterprise Edition - Version: 11.2.0.1 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms

In 11.2.0.1.0, the validation of XML documents (using XMLType.schemaValidate()) against an XML schema with elements with fixed boolean values does not work.  It returns an LSX-00205 errorstack.

For example, this code:

declare
  xml_doc XMLType;
begin
  DBMS_XMLSCHEMA.registerSchema
    (SCHEMAURL => 'Error2.xsd',
     SCHEMADOC => '
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="A">
<xs:complexType>
<xs:sequence>
<xs:element name="B" type="xs:boolean" fixed="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>',
     LOCAL => FALSE,
     GENTYPES => TRUE,
     GENTABLES => FALSE
     );

xml_doc := XMLType(
'<A xsi:noNamespaceSchemaLocation="Error2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<B>0</B>
</A>'
);

XMLType.schemaValidate(xml_doc);
end;
/

fails in SQL*Plus with this errorstack:

declare
*
ERROR at line 1:
ORA-31154: invalid XML document
ORA-19202: Error occurred in XML processing
LSX-00205: element "B" value "false" is wrong (must be "0")
ORA-06512: at "SYS.XMLTYPE", line 354
ORA-06512: at line 27

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms