Xerces&XMLSpy validations

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.
 
B

Bob Foster

You're asking someone to go to a lot of work to fix your problems. How about
you narrow down what the error messages are saying yourself and if you
disagree with them, post again and say why?

The fact that validation under XMLSpy passed successfully means nothing.
This sort of thing is reported all the time. Not to pick on XMLSpy (though
the name does come up a lot in this context), two XML Schema processors
frequently report different errors. If is up to you to decide if they are
really errors.

It might also help you to try XSV or Sun's MSV. But there is no sure path
except understanding the problem, since it is often the case that only one
parser out of many will correctly diagnose a problem. That's the current
state of the art for XSDL.

Bob Foster

Alexey V. Dmitriev said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top