Schema: problem with order of fields in extended element

Discussion in 'XML' started by Maciej Zoltowski, Dec 5, 2003.

  1. Hi,

    I've got a following problem with the order of fields in extended
    element: let's assume, that I have a complex type with a few fields,
    that I want to extend with additional field. In extended type I would
    like to have the possibility of entering fields (both from base and
    extended type) in any order, but during validation XMLSPY shows me an
    error. What am I doing wrong?

    Sample schema definition:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs=""
    elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="tmp">
    <xs:extension base="tmp2">
    <xs:all minOccurs="0">
    <xs:element name="c" minOccurs="0"/>
    <xs:complexType name="tmp2">
    <xs:element name="a" minOccurs="0"/>
    <xs:element name="b" minOccurs="0"/>

    and the sample incorrect data file:
    <?xml version="1.0" encoding="UTF-8"?>
    <tmp xmlns:xsi=""

    Maciej Zoltowski, Dec 5, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.