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">
    <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!

    --
    ========================================================================
    Ian Pilcher
    ========================================================================
    Ian Pilcher, Aug 20, 2005
    #1
    1. Advertising

  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: www.w3.org/TR/xmlschema-0/

    Soren
    Soren Kuula, Aug 20, 2005
    #2
    1. Advertising

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.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,528
    Markus
    Nov 23, 2005
  2. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,250
    Stanimir Stamenkov
    Apr 25, 2005
  3. Replies:
    3
    Views:
    2,833
  4. Generic Usenet Account

    q) XML Schema and valid XML documents

    Generic Usenet Account, Oct 30, 2009, in forum: XML
    Replies:
    3
    Views:
    1,088
    Peter Flynn
    Nov 2, 2009
  5. Replies:
    5
    Views:
    1,006
    Brian McCauley
    Nov 29, 2006
Loading...

Share This Page