I'm curious as to others' experience in wrapping data with hyperlinks.
In my case, I am to write a gateway that provides access to documents
of a XML schema that does not have facility for linking. Here's an
example document:
<shipping_manifest id="9883">
<destination>
<customer id="82"><name>a name</name><address>an
address</address></customer>
</destination>
<shipped_items>
<item id="102"><description>FlashLight FL-100</description>
<item id="382"><description>Lantern LA-221</description>
</shipped_items>
</shipping_manifest>
I do not want and am not allowed to change the schema because it may
break existing clients.
So I decided to create a new schema that wraps around the existing
one. It will allow links to be specified for any element in the
wrapped document. Example below.
How would you approach this problem?
YS
<hyperlinked_document>
<wrapped_document>
<shipping_manifest id="9883">
<destination>
<customer id="82"><name>a name</name><address>an
address</address></customer>
</destination>
<shipped_items>
<item id="102"><description>FlashLight FL-100</description>
<item id="382"><description>Lantern LA-221</description>
</shipped_items>
</shipping_manifest>
</wrapped_document>
<links xmlns:xlink="http://www.w3.org/1999/xlink">
<link
xpath="/hyperlinked_document/wrapped_document/shipping_manifest[@id='9893']"
xlink:title="Current Document"
xlink:type="simple"
xlink:role="http://gateway/linkprops/self"
xlink:href="http://gateway/wrapped/shipping_manifest/9883"/>
<link
xpath="/hyperlinked_document/wrapped_document/shipping_manifest[@id='9893']"
xlink:title="Shipping Manifest #9893"
xlink:type="simple"
xlink:role="http://gateway/linkprops/shipping_manifest"
xlink:href="http://gateway/wrapped/shipping_manifest/9883"/>
<link
xpath="/hyperlinked_document/wrapped_document/shipping_manifest[@id='9893']/dest\
ination/customer[@id='82']"
xlink:title="customer #82"
xlink:type="simple"
xlink:role="http://gateway/linkprops/customer"
xlink:href="http://gateway/wrapped/customer/82"/>
<link
xpath="/hyperlinked_document/wrapped_document/shipping_manifest[@id='9893']/ship\
ped_items/item[@id='102']"
xlink:title="item #102"
xlink:type="simple"
xlink:role="http://gateway/linkprops/item"
xlink:href="http://gateway/wrapped/item/102"/>
<link
xpath="/hyperlinked_document/wrapped_document/shipping_manifest[@id='9893']/ship\
ped_items/item[@id='382']"
xlink:title="item #382"
xlink:type="simple"
xlink:role="http://gateway/linkprops/item"
xlink:href="http://gateway/wrapped/item/382"/>
</links>
</hyperlinked_document>