A
Alexey V. Dmitriev
Hi, ALL!
Try to parse my XML doc with Xerces2-J (v.2.2.0), but ErrorHandler
return errors a course of this proccess. All needed features were turn
on. BTW, validation under XMLSpy tool passed successfully. What's
wrong? Really these two tools (Xerces and XMLSpy) work on
miscellaneous? Below the fragment of the scheme and XML-data itself
are given.
=================My XML Schema===================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="tests">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="class">
<xs:complexType>
<xs:complexContent>
<xs:extension base="classType">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="classType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="params" type="paramType" minOccurs="0"/>
<xs:element name="method">
<xs:complexType>
<xs:complexContent>
<xs:extension base="methodType">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="test-case" type="xs:string" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- Something unessential is dropped -->
<xs:complexType name="paramType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="param">
<xs:complexType>
<xs:complexContent>
<xs:extension base="anyType">
<!-- In fact the following line is 58 -->
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="assertType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="assert">
<xs:complexType>
<xs:complexContent>
<xs:extension base="anyType">
<!-- In fact the following line is 75 -->
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="action" type="actionType" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- Something unessential is dropped -->
<xs:complexType name="anyType" mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any namespace="##any" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
==============My XML data============================
<?xml version="1.0" encoding="UTF-8"?>
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="jtestcase-2.xsd">
<class name="TestFindService">
<params>
<param name="unitFirst" type="java.lang.String">TroubleTktMgr</param>
<param name="unitSecond" type="java.lang.String">TypeTester</param>
</params>
<method name="testAOExistence" test-case="positive-key-exists">
<params>
<param name="tomId" type="int">21</param>
<param name="classcode" type="int">2601</param>
<param name="instLeft" type="int">1376261</param>
<param name="instRite" type="int">1061789317</param>
</params>
</method>
</class>
</tests>
====================================================
Output errors are:
1. [Error] at line number, 58: cos-ct-extends.1.4.2.2.2.2.1: Error for
type '#AnonType_paramparamType'. The content type of a derived type
and that of its base must both be mixed or element-only.
2. [Error] at line number, 75: cos-ct-extends.1.4.2.2.2.2.1: Error for
type '#AnonType_assertassertType'. The content type of a derived type
and that of its base must both be mixed or element-only.
Very need help.
Try to parse my XML doc with Xerces2-J (v.2.2.0), but ErrorHandler
return errors a course of this proccess. All needed features were turn
on. BTW, validation under XMLSpy tool passed successfully. What's
wrong? Really these two tools (Xerces and XMLSpy) work on
miscellaneous? Below the fragment of the scheme and XML-data itself
are given.
=================My XML Schema===================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="tests">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="class">
<xs:complexType>
<xs:complexContent>
<xs:extension base="classType">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="classType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="params" type="paramType" minOccurs="0"/>
<xs:element name="method">
<xs:complexType>
<xs:complexContent>
<xs:extension base="methodType">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="test-case" type="xs:string" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- Something unessential is dropped -->
<xs:complexType name="paramType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="param">
<xs:complexType>
<xs:complexContent>
<xs:extension base="anyType">
<!-- In fact the following line is 58 -->
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="assertType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="assert">
<xs:complexType>
<xs:complexContent>
<xs:extension base="anyType">
<!-- In fact the following line is 75 -->
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="action" type="actionType" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- Something unessential is dropped -->
<xs:complexType name="anyType" mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any namespace="##any" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
==============My XML data============================
<?xml version="1.0" encoding="UTF-8"?>
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="jtestcase-2.xsd">
<class name="TestFindService">
<params>
<param name="unitFirst" type="java.lang.String">TroubleTktMgr</param>
<param name="unitSecond" type="java.lang.String">TypeTester</param>
</params>
<method name="testAOExistence" test-case="positive-key-exists">
<params>
<param name="tomId" type="int">21</param>
<param name="classcode" type="int">2601</param>
<param name="instLeft" type="int">1376261</param>
<param name="instRite" type="int">1061789317</param>
</params>
</method>
</class>
</tests>
====================================================
Output errors are:
1. [Error] at line number, 58: cos-ct-extends.1.4.2.2.2.2.1: Error for
type '#AnonType_paramparamType'. The content type of a derived type
and that of its base must both be mixed or element-only.
2. [Error] at line number, 75: cos-ct-extends.1.4.2.2.2.2.1: Error for
type '#AnonType_assertassertType'. The content type of a derived type
and that of its base must both be mixed or element-only.
Very need help.