I
Ian Pilcher
I am using an XML-based format to define my applications data types.
For example, here are the "primitive" types that holds a Java Integers
and Floats:
<type name="int" class="Value">
<parameters>
<parameter name="valueClass" value="java.lang.Integer"/>
</parameters>
</type>
<type name="float" class="Value">
<parameters>
<parameter name="valueClass" value="java.lang.Float"/>
</parameters>
</type>
(Type "parameters" are used to create multiple types from a single Java
class.)
More sophisticated types have "properties":
<type name="complex" class="Cluster">
<properties>
<property name="real" type="float"/>
<property name="imaginary" type="float"/>
</properties>
</type>
(Like Value, Cluster is a Java class that is used for multiple types,
but Cluster-based types do not have parameters; they are completely
defined by their properties.)
My question revolves around the 'type="float"' attribute in the
"complex" type's properties. Is it possible to somehow reference the
previous type definition, rather than simply treating it as a string?
This would allow the XML parser to catch any references to non-existant
types.
Is there a way to do this is an XML schema (W3C style)?
Thanks!
For example, here are the "primitive" types that holds a Java Integers
and Floats:
<type name="int" class="Value">
<parameters>
<parameter name="valueClass" value="java.lang.Integer"/>
</parameters>
</type>
<type name="float" class="Value">
<parameters>
<parameter name="valueClass" value="java.lang.Float"/>
</parameters>
</type>
(Type "parameters" are used to create multiple types from a single Java
class.)
More sophisticated types have "properties":
<type name="complex" class="Cluster">
<properties>
<property name="real" type="float"/>
<property name="imaginary" type="float"/>
</properties>
</type>
(Like Value, Cluster is a Java class that is used for multiple types,
but Cluster-based types do not have parameters; they are completely
defined by their properties.)
My question revolves around the 'type="float"' attribute in the
"complex" type's properties. Is it possible to somehow reference the
previous type definition, rather than simply treating it as a string?
This would allow the XML parser to catch any references to non-existant
types.
Is there a way to do this is an XML schema (W3C style)?
Thanks!