Schema validation of "links" within XML documents

Discussion in 'XML' started by Ian Pilcher, Aug 20, 2005.

  1. Ian Pilcher

    Ian Pilcher Guest

    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">
    <parameter name="valueClass" value="java.lang.Integer"/>

    <type name="float" class="Value">
    <parameter name="valueClass" value="java.lang.Float"/>

    (Type "parameters" are used to create multiple types from a single Java

    More sophisticated types have "properties":

    <type name="complex" class="Cluster">
    <property name="real" type="float"/>
    <property name="imaginary" type="float"/>

    (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

    Is there a way to do this is an XML schema (W3C style)?


    Ian Pilcher
    Ian Pilcher, Aug 20, 2005
    1. Advertisements

  2. Ian Pilcher

    Soren Kuula Guest

    Ian Pilcher wrote:
    > Is there a way to do this is an XML schema (W3C style)?

    Yes, there is, and any reasonably complete XML Schema tutorial will tell
    you how. For example:

    Soren Kuula, Aug 20, 2005
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.