My program relies heavily  on the functionality of the  DOMNormalizer for editing XML in a tree.
I think there is problem with schemas containing abstract type definitions.

The xml validates OK using standard validation, but the DOMNormalizer returns:
Program started
handleError cvc-elt.4.2: Cannot resolve 'standardinfo' to a type definition for element 'networkinfo'.
handleError cvc-type.2: The type definition cannot be abstract for element networkinfo.
handleError cvc-complex-type.2.1: Element 'networkinfo' must have no character or element information item [children], because the type's content type is empty.

Regards 
Dick Deneer

PS
I tested this with Xerces 2.9.0. 

XML

<networkinfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="standardinfo">
<ipadress/>
<hostname/>
<dnsserver/>
</networkinfo>


XSD
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="networkinfo" type="info"/>
   <xs:complexType name="info" abstract="true"/>
   <xs:complexType name="standardinfo">
      <xs:complexContent>
         <xs:extension base="info">
            <xs:sequence>
               <xs:element name="ipadress" type="xs:string"/>
               <xs:element name="hostname" type="xs:string"/>
               <xs:element name="dnsserver" type="xs:string"/>
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>
   <xs:complexType name="dhcpinfo">
      <xs:complexContent>
         <xs:extension base="info">
            <xs:sequence>
               <xs:element name="dhcp" type="xs:string"/>
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>
</xs:schema>
<networkinfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="standardinfo">
	<ipadress/>
	<hostname/>
	<dnsserver/>
</networkinfo>

Attachment: abstract_type.xsd
Description: Binary data

Attachment: TestNormalize.java
Description: Binary data

Reply via email to