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

Difference between revisions of "COSMOS Design 238492"

m (flesh out)
m (flesh out reqts)
Line 58: Line 58:
  
 
=Requirements=
 
=Requirements=
Add a level of abstraction around the query and registration processing framework to make it optional, and make it possible to replace the processing framework with another implementation.  
+
* 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.
== Use case ==
+
** SML-IF prescribes that when both mechanisms can be used to calculate a base URI for the same element, xml:base wins.
[http://wiki.eclipse.org/COSMOS_Use_Cases#SML_and_SML-IF_validation_support SML validation support]
+
** 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)
 +
<source lang="xml">
 +
<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>
 +
</source>
 +
** xml:base might be specified to establish a base URI for a relative reference found in smlif:baseURI at the document level, e.g.
 +
<source lang="xml">
 +
<smlif:docInfo xml:base="http://www.example.org">
 +
  <smlif:baseURI>foo/bar</smlif:baseURI>
 +
</smlif:docinfo>
 +
</source>
 +
* 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=
 
=Design details=

Revision as of 11:59, 16 January 2009

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  ? John Arwe, David Whiteman
Code  ? John Arwe, David Whiteman
Test  ? John Arwe
Documentation 0
Build and infrastructure 0
Code review, etc.*
TOTAL  ?

'* - 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