Xerces&XMLSpy validations

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexey V. Dmitriev

    #1

    Xerces&XMLSpy validations

    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"
    elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
    <xs:element name="tests">
    <xs:complexType >
    <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    <xs:element name="class">
    <xs:complexType >
    <xs:complexCont ent>
    <xs:extension base="classType ">
    <xs:attribute name="name" type="xs:string " use="required"/>
    </xs:extension>
    </xs:complexConte nt>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:complexTy pe name="classType ">
    <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    <xs:element name="params" type="paramType " minOccurs="0"/>
    <xs:element name="method">
    <xs:complexType >
    <xs:complexCont ent>
    <xs:extension base="methodTyp e">
    <xs:attribute name="name" type="xs:string " use="required"/>
    <xs:attribute name="test-case" type="xs:string " use="required"/>
    </xs:extension>
    </xs:complexConte nt>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <!-- Something unessential is dropped -->
    <xs:complexTy pe name="paramType ">
    <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    <xs:element name="param">
    <xs:complexType >
    <xs:complexCont ent>
    <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:complexConte nt>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexTy pe name="assertTyp e">
    <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    <xs:element name="assert">
    <xs:complexType >
    <xs:complexCont ent>
    <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="actionTyp e" use="required"/>
    </xs:extension>
    </xs:complexConte nt>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <!-- Something unessential is dropped -->
    <xs:complexTy pe name="anyType" mixed="true">
    <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    <xs:any namespace="##an y" processContents ="skip"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    ==============M y XML data=========== =============== ==
    <?xml version="1.0" encoding="UTF-8"?>
    <tests xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespace SchemaLocation= "jtestcase-2.xsd">
    <class name="TestFindS ervice">
    <params>
    <param name="unitFirst " type="java.lang .String">Troubl eTktMgr</param>
    <param name="unitSecon d" type="java.lang .String">TypeTe ster</param>
    </params>
    <method name="testAOExi stence" 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">1376 261</param>
    <param name="instRite" type="int">1061 789317</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_para mparamType'. 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_asse rtassertType'. The content type of a derived type
    and that of its base must both be mixed or element-only.

    Very need help.
  • Bob Foster

    #2
    Re: Xerces&amp;XMLS py validations

    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" <davrkc@applied tech.ru> wrote in message
    news:sremkv0j3r m20i8oce840fg1r 34hubkb8k@4ax.c om...[color=blue]
    > 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"
    > elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
    > <xs:element name="tests">
    > <xs:complexType >
    > <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    > <xs:element name="class">
    > <xs:complexType >
    > <xs:complexCont ent>
    > <xs:extension base="classType ">
    > <xs:attribute name="name" type="xs:string " use="required"/>
    > </xs:extension>
    > </xs:complexConte nt>
    > </xs:complexType>
    > </xs:element>
    > </xs:sequence>
    > </xs:complexType>
    > </xs:element>
    > <xs:complexTy pe name="classType ">
    > <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    > <xs:element name="params" type="paramType " minOccurs="0"/>
    > <xs:element name="method">
    > <xs:complexType >
    > <xs:complexCont ent>
    > <xs:extension base="methodTyp e">
    > <xs:attribute name="name" type="xs:string " use="required"/>
    > <xs:attribute name="test-case" type="xs:string " use="required"/>
    > </xs:extension>
    > </xs:complexConte nt>
    > </xs:complexType>
    > </xs:element>
    > </xs:sequence>
    > </xs:complexType>
    > <!-- Something unessential is dropped -->
    > <xs:complexTy pe name="paramType ">
    > <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    > <xs:element name="param">
    > <xs:complexType >
    > <xs:complexCont ent>
    > <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:complexConte nt>
    > </xs:complexType>
    > </xs:element>
    > </xs:sequence>
    > </xs:complexType>
    > <xs:complexTy pe name="assertTyp e">
    > <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    > <xs:element name="assert">
    > <xs:complexType >
    > <xs:complexCont ent>
    > <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="actionTyp e" use="required"/>
    > </xs:extension>
    > </xs:complexConte nt>
    > </xs:complexType>
    > </xs:element>
    > </xs:sequence>
    > </xs:complexType>
    > <!-- Something unessential is dropped -->
    > <xs:complexTy pe name="anyType" mixed="true">
    > <xs:sequence minOccurs="0" maxOccurs="unbo unded">
    > <xs:any namespace="##an y" processContents ="skip"/>
    > </xs:sequence>
    > </xs:complexType>
    > </xs:schema>
    > ==============M y XML data=========== =============== ==
    > <?xml version="1.0" encoding="UTF-8"?>
    > <tests xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    > xsi:noNamespace SchemaLocation= "jtestcase-2.xsd">
    > <class name="TestFindS ervice">
    > <params>
    > <param name="unitFirst " type="java.lang .String">Troubl eTktMgr</param>
    > <param name="unitSecon d" type="java.lang .String">TypeTe ster</param>
    > </params>
    > <method name="testAOExi stence" 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">1376 261</param>
    > <param name="instRite" type="int">1061 789317</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_para mparamType'. 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_asse rtassertType'. The content type of a derived type
    > and that of its base must both be mixed or element-only.
    >
    > Very need help.[/color]


    Comment

    Working...