circular definition

C

CHAOS

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.
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top