circular definition

Discussion in 'XML' started by CHAOS, Dec 24, 2004.

  1. CHAOS

    CHAOS Guest

    I am trying to set up a schema that will define a structure to hold
    simple lines of code, where lines consist of function calls with
    parameters that may or may not be function calls themselves. For
    instance, I might encode the line:

    Move ( Hero, DirectionObjectFaces ( Hero ) );

    something like:

    <Command type="Move">
    <Param> Hero </Param>
    <Param>
    <Command type="DirectionObjectFaces">
    <Param> Hero </Param>
    </Command>
    </Param>
    </Command>

    My attempted xml schema is:

    <?xml version="1.0" encoding="UTF-16"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">


    <xsd:complexType name="CommandType">
    <xsd:complexContent>
    <xsd:restriction base="ParamType"/>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="ParamType">
    <xsd:complexContent>
    <xsd:extension base="CommandType"/>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:schema>

    However, I get an error when validating the document:
    "No circular definitions are allowed"
    How can I structure this to avoid circular definitions? And why are
    circular definitions illegal in the first place? Thanks in advance.
    CHAOS, Dec 24, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kiuhnm
    Replies:
    16
    Views:
    731
    Jonathan Mcdougall
    Jan 3, 2005
  2. Jianli Shen
    Replies:
    1
    Views:
    568
    Victor Bazarov
    Mar 13, 2005
  3. Ark
    Replies:
    1
    Views:
    406
    Chris Torek
    Aug 7, 2004
  4. Jon Slaughter
    Replies:
    4
    Views:
    433
    Jon Slaughter
    Oct 26, 2005
  5. Pierre Yves
    Replies:
    2
    Views:
    474
    Pierre Yves
    Jan 10, 2008
Loading...

Share This Page