Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

COSMOS Design 238492

Revision as of 12:01, 16 January 2009 by Johnarwe.us.ibm.com (Talk | contribs) (flesh out Workload Estimation)

Support xml:base in SML validator

Change History

Name: Date: Revised Sections:
David Whiteman January 14, 2009
  • Initial version

Workload Estimation

Rough workload estimate in person weeks
Process Sizing Names of people doing the work
Design 1 John Arwe, David Whiteman
Code 2 John Arwe, David Whiteman
Test 3 John Arwe
Documentation 0
Build and infrastructure 0
Code review, etc.* 1
TOTAL 7

'* - includes other committer work (e.g. check-in, contribution tracking)

Purpose

This enhancement will provide a basic implementation of xml:base per the SML-IF 1.1 specification. SML-IF requires producers to support xml:base, and allows consumers to support it, as a mechanism for transforming relative references to absolute URIs RFC 3986.

Relative references may be used in many places in an SML-IF document, e.g. SML references (as sml:uri content), smlif:baseURI content (to establish model and/or document base URIs), rule bindings, and schema bindings.

Requirements

  • Calculate the base URI, at any element in the SML-IF document, that will be used if necessary to transform a relative reference into an absolute URI.
    • A single document may use a combination of xml:base and smlif:baseURI to establish base URIs at various points in the document.
    • SML-IF prescribes that when both mechanisms can be used to calculate a base URI for the same element, xml:base wins.
    • SML-IF allows separate base URIs to be established for each document, using either smlif:baseURI, xml:base, both, or a combination of mechanisms.
  • Be very careful about boundary cases, which are very easy to get wrong.
    • xml:base might be specified on sml:uri (i.e. within an SML reference element)
<my:element sml:ref="true"> <!-- The SML reference element -->
   <sml:uri xml:base="http://www.example.org/a/different/base">foo/bar</sml:uri>
</my:element>
    • xml:base might be specified to establish a base URI for a relative reference found in smlif:baseURI at the document level, e.g.
<smlif:docInfo xml:base="http://www.example.org">
   <smlif:baseURI>foo/bar</smlif:baseURI>
</smlif:docinfo>
  • Since aliases and SML references can contain relative references, they can no longer be compared "as-is" since doing so implicitly treats them as absolute URIs. Any relative reference must be transformed into an absolute URI prior to comparison.
    • Calculating the base URI using xml:base requires that the entire ancestor axis, not only the element containing the relative reference, be available when the code needs to transform a relative reference.

Design details

Impacts of this enhancement

Open Issues/Questions

Back to the top