C
Christine McGavran
I have created an xml format for describing a custom user interface. My
application successfully parses and displays the UI described in xml files
created in that format.
Before today we were using Visual Studio .net 2002. I created a schema file
to describe my xml so that I could use the fancy xml editing capabilities in
the Visual Studio enviroment. With this schema referenced, I could
auto-complete while scripting xml for my user interface while editing in
DevStudio. A pretty neat feature, even though it wasn't really necessary.
Today we upgraded to Visual Studio .net 2003. One of the changes seems to be
that schema files are compiled instead of interpreted directly. The compiler
gives the following error on compile: "DataSet doesn't allow the circular
reference in the ComplexType named 'Window'". So no more fancy editing.
This isn't a Microsoft-specific problem, I get a similar error if I try to
use an application I downloaded via w3.org to validate xml using my schema.
My script allows you to create windows with child windows, which can also
have children. A pretty standard windowing system, I think. But it doesn't
seem legal xml to make a window element a child of a window element. I'm not
really familiar with all the logic and theory behind xml, I just thought it
was a convenient way to script our UI. I would like to understand why these
"circular references" are not allowed in the schema, and what alternatives a
proper xml guru might suggest for my situation.
Below is a simple schema that has this problem
<schema targetNamespace="test.xsd" elementFormDefault="qualified"
xmlns=http://www.w3.org/2001/XMLSchema xmlns:ui="test.xsd">
<element name="test">
<complexType>
<sequence>
<element name="window" type="ui:Window" />
</sequence>
</complexType>
</element>
<complexType name="Window">
<sequence>
<element name="children">
<complexType>
<sequence>
<element name="childWindow"
type="ui:Window" />
</sequence>
</complexType>
</element>
<element name="testString" type="string" />
</sequence>
</complexType>
</schema>
application successfully parses and displays the UI described in xml files
created in that format.
Before today we were using Visual Studio .net 2002. I created a schema file
to describe my xml so that I could use the fancy xml editing capabilities in
the Visual Studio enviroment. With this schema referenced, I could
auto-complete while scripting xml for my user interface while editing in
DevStudio. A pretty neat feature, even though it wasn't really necessary.
Today we upgraded to Visual Studio .net 2003. One of the changes seems to be
that schema files are compiled instead of interpreted directly. The compiler
gives the following error on compile: "DataSet doesn't allow the circular
reference in the ComplexType named 'Window'". So no more fancy editing.
This isn't a Microsoft-specific problem, I get a similar error if I try to
use an application I downloaded via w3.org to validate xml using my schema.
My script allows you to create windows with child windows, which can also
have children. A pretty standard windowing system, I think. But it doesn't
seem legal xml to make a window element a child of a window element. I'm not
really familiar with all the logic and theory behind xml, I just thought it
was a convenient way to script our UI. I would like to understand why these
"circular references" are not allowed in the schema, and what alternatives a
proper xml guru might suggest for my situation.
Below is a simple schema that has this problem
<schema targetNamespace="test.xsd" elementFormDefault="qualified"
xmlns=http://www.w3.org/2001/XMLSchema xmlns:ui="test.xsd">
<element name="test">
<complexType>
<sequence>
<element name="window" type="ui:Window" />
</sequence>
</complexType>
</element>
<complexType name="Window">
<sequence>
<element name="children">
<complexType>
<sequence>
<element name="childWindow"
type="ui:Window" />
</sequence>
</complexType>
</element>
<element name="testString" type="string" />
</sequence>
</complexType>
</schema>