Anyway to constrain what a link points to?

Hi,

XLink lets me include references to other resources. However, as far as I
could tell, it does not let me constrain the content of the resource. 

e.g.

Let's say that I have the following schema

<?xml version="1.0" ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            targetNamespace="http://www.example.com/container"
            xmlns="http://www.example.com/container"
            elementFormDefault="qualified">

<xsd:element name="container">
    <xsd:complexType>
        <xsd:choice>
            <xsd:element name="element1">
                <xsd:attribute name="xlink:type" fixed="simple" />
                <xsd:attribute name="xlink:href" use="required" />
                <xsd:attribute name="namespaceConstraint"
fixed="http://www.example.com/foo" />
            </xsd:element>
            <xsd:element name="element2">
                <xsd:attribute name="xlink:type" fixed="simple" />
                <xsd:attribute name="xlink:href" use="required" />
                <xsd:attribute name="namespaceConstraint"
fixed="http://www.example.com/bar" />
            </xsd:element>
        </xsd:choice>
    </xsd:complexType>
</xsd:element>
</xsd:schema>

In the above schema, I am using the attribute "namespaceConstraint" to
specify that the remote resource referenced by element1 should conform to
the "http://www.example.com/foo.xsd" schema and the remote resource
referenced by element2 should conform to the  http://www.example.com/bar.xsd
schema.

Is there any standard way to specify the above constraint? I did not find
support in the Xlink specification for this. If there is support either in
xlink or some other standard to achieve the above, can someone please point
me to that.


Thanks

--
Chelliah

Received on Thursday, 29 November 2001 09:03:05 UTC