The Service Modeling Language [SML] specification extends the Extensible Mark-up Language [XML] and XML Schema [XML Schema] with a mechanism for incorporating into XML documents references to other documents or document fragments. This technical note addresses the construction of an SML reference scheme based on the XML Linking Language [XLink].
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This is the W3C Working Group Note "The SML XLink Reference Scheme". This document was produced by the SML Working Group as part of the XML Activity.
Please submit comments on this document using the procedure described on the Working Group's home page. In summary, the Working Group solicits comments in Bugzilla from those who have access, and on the Working Group's public mailing list (public archive) from others.
Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document is intended to illustrate the design of an SML reference scheme based on XML Linking Language [XLink] links. Currently, this document is consistent with the Service Modeling Language (SML) 1.1 specification [SML] and the Service Modeling Language Interchange Format (SML-IF) 1.1 specification [SML-IF], but it may be obsoleted by future versions of these specifications. The SML WG does not expect this document to become a W3C Recommendation.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
The Service Modeling Language [SML] specification extends the Extensible Mark-up Language [XML] and XML Schema [XML Schema] with a mechanism for incorporating into XML documents references to other documents or document fragments. A reference to another document or document fragment is encoded by means of markup compliant with one or more reference schemes as defined in SML ([SML], section 4.3). The SML specification defines one reference scheme, the SML URI Reference Scheme, which enables XML documents to use URIs [RFC 3986] to identify documents or document fragments. The SML URI Reference Scheme has the significant advantage of guaranteeing referential conformance of models that are exchanged between vendors ([SML-IF], section 5.1).
The SML specification does not mandate the use of any specific reference scheme, and provides an extensibility mechanism for defining new reference schemes. This note illustrates how the extensibility mechanism can be used to define an SML reference scheme based on XLink links.
xlink prefix is used throughout this document to stand for the
declaration of the XLink namespace on elements in whose scope the so-marked attribute
appears (on the same element that bears the attribute or on some ancestor element),
whether or not an XLink namespace declaration is present in the example.
The SML XLink Reference Scheme is defined as follows:
An SML reference is identified as an instance of the SML XLink Reference Scheme if and only if the following condition is true:
It has an attribute information item whose [local name] is href, and whose [namespace name] is http://www.w3.org/1999/xlink.
An instance of the SML XLink Reference Scheme is valid if it meets all of the following requirements:
The content of xlink:href is of type xs:anyURI [XSD Datatypes].
The fragment component (if present) follows the syntax of one of the following:
The smlxpath1() XPointer scheme as defined in [SML]
An XPointer shorthand pointer as defined in [XPointer]
An SML reference that is an instance of the SML XLink Reference Scheme is resolved using the following steps:
Let U be the URI reference that is the content of xlink:href. Let S be the specification that defines the URI scheme of U.
An XML document D is obtained as follows:
If U is a same-document reference, then D is the document containing the SML reference.
Otherwise, D is determined as follows:
If U is a relative reference, then let U′ be the result of transforming U to form an (absolute) URI using the [base URI] property [XML Infoset] of the SML reference element as the base URI. Otherwise, let U′ be U (i.e., the URI reference itself). The computation of the [base URI] property is implementation-defined.
Dereference U′ as defined in S. If the document targeted by U′ is in the current SML model, then D is that document. Otherwise, if the document is not in the current SML model, then the SML XLink Reference Scheme instance is unresolved (and D has no value).
If the retrieved object is not of XML media type or if it is not well-formed XML then, per the definition in section 2.2 of [SML], that object is not a document. In this case, the SML reference scheme instance is unresolved.
If no fragment component is present in U, the SML XLink Reference Scheme instance resolves to the root element of D.
If a fragment component is present in U, then the appropriate case among the following applies:
If the fragment component complies with the smlxpath1() XPointer scheme syntax, then the reference target is obtained by applying the fragment component to D, as defined in section 220.127.116.11 of [SML].
If the fragment component complies with the shorthand pointer syntax, then the appropriate case among the following applies:
If a target T can be identified in D based on the schema-determined ID, then the reference target is T.
If a target in D cannot be identified based on the schema-determined ID, then it is implementation-defined whether the reference target in D is identified based on other criteria allowed for shorthand pointers.
The following example illustrates an instance of the XLink Reference Scheme:
<Student> <ID>123</ID> <Name>Jane Doe</Name> <EnrolledCourses> <EnrolledCourse xmlns:sml="http://www.w3.org/ns/sml" xmlns:xlink="http://www.w3.org/1999/xlink" sml:ref="true" sml:nilref="false" xlink:href="http://www.university.example.org/phy101.xml" </EnrolledCourse> </EnrolledCourses> </Student>
Here, the EnrolledCourse element is a valid instance of the SML XLink Reference Scheme since an attribute xlink:href is present and its content is of type xs:anyURI. It is also an SML reference since the content of sml:ref is the string true; in particular, it is a non-null SML reference since the content of sml:nilref is the string false. The target of the reference is the root element of the XML document obtained by dereferencing http://www.university.example.org/phy101.xml.
The following example illustrates an instance of XLink Reference Scheme where the content of xlink:href has a fragment component that follows the syntax of the smlxpath1() XPointer scheme:
<Student> <ID>123</ID> <Name>Jane Doe</Name> <EnrolledCourses> <EnrolledCourse xmlns:sml="http://www.w3.org/ns/sml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:u="http://www.university.example.org/ns" sml:ref="true" sml:nilref="false" xlink:href="http://www.university.example.org/physics.xml #smlxpath1(u:Courses/u:Course[u:Name='PHY101'])" </EnrolledCourse> </EnrolledCourses> </Student>
In the above example, the target of the reference is the element identified by the path /u:Courses/u:Course[u:Name='PHY101'] in the XML document obtained by dereferencing http://www.university.example.org/physics.xml.