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