Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


How to represent links within XML & XSD?

From: akunal@-----.---
To: NULL
Date: 5/4/2006 10:25:00 AM

I'm trying to represent a linked relationship among between nodes as
follows:

<!-- Top level nodes -->
<Cities>
    <City>Los Angeles</City>
    <City>San Francisco</City>
    <City>Seattle</City>
    <City>Washington DC</City>
</Cities>
...
<Dimensions>
    <Weight>
        <Metric>
            <Tonnes>
                2.5
            </Tonnes>
        </Metric>
    </Weight>
    <Height>
        <Metric>
            <Metres>
                6.4
            </Metres>
        </Metric>
    </Height>
</Dimensions>
...

<!-- User level nodes -->
<Address>
    <Line1>...</Line1>
    <Line2>...</Line2>
    <City>/Cities/City[2]</City> <!-- Links to top level nodes -->
</Address>

<Truck>
    <Capacity>
        <Weight>/Dimensions/Weight/Metric/Tonnes</Weight>  <!-- Links
to top level nodes -->
        <Height>/Dimensions/Height/Metric/Metres</Height>  <!-- Links
to top level nodes -->
    </Capacity>
</Truck>


Is it possible to represent this relationship both at design-time (in
the schema/XSD) and at run-time (in the XML document)?

Is there a way to do this in XLink/XPointers such that in Java code I
could, for example, transparently use the linked objects as follows:

System.out.println(address.city);
System.out.println(truck.capacity.weight);
System.out.println(truck.capacity.height);

(Unless I absolutely have to, I don't want to write additional code to
"understand" the semantics of the links to the city, height and weight.
That is, in a Java program, the links should "automatically" refer to
and retrieve the top-level data as "objects" rather than just plain
strings.

Thanks in advance,
Kunal



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent