Schema validation of "links" within XML documents

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!
 

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

No members online now.

Forum statistics

Threads
474,001
Messages
2,570,251
Members
46,850
Latest member
Brightrs

Latest Threads

Top