This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5303 - Recognize URI scheme without schema assessment
Summary: Recognize URI scheme without schema assessment
Status: RESOLVED FIXED
Alias: None
Product: SML
Classification: Unclassified
Component: Core (show other bugs)
Version: FPWD
Hardware: PC Windows XP
: P2 normal
Target Milestone: LC
Assignee: Valentina Popescu
QA Contact: SML Working Group discussion list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2007-12-06 15:00 UTC by Sandy Gao
Modified: 2008-01-03 19:29 UTC (History)
0 users

See Also:


Attachments

Description Sandy Gao 2007-12-06 15:00:11 UTC
In the URI scheme definition:

"1. An SML reference element is identified as using the SML URI scheme if and only if exactly one instance of the sml:uri global element declaration is present as a child of that reference element."

Suggest to replace it with

"1. An SML reference element is identified as using the SML URI scheme if and only if exactly one element information item with the name sml:uri is present as a child of that reference element."

This makes it possible to identify SML URI scheme instances without schema assessment. It also avoid certain strange cases. For example, if the schema has:

<element name="myRef">
  <complexType>
    <sequence>
      <element ref="sml:uri"/>
      <any processContents="skip"/>
    </sequence>
  </complexType>
</element>

And in the instance:
<myRef sml:ref="true">
  <sml:uri> abc </sml:uri>
  <sml:uri> xyz </sml:uri>
</myRef>

Then according to the current definition, this is viewed as an instance of the URI scheme, because only the first <sml:uri> matches the global element declaration and the second matches the wildcard.
Comment 1 C. M. Sperberg-McQueen 2007-12-06 19:16:33 UTC
(Slightly pedantic editorial note:)

For readers who think in terms of either the XML grammar or in terms of the
XPath and XDM data models, the phrase 'the name sml:uri' can be misinterpreted
as constraining just the prefix and local name, not the namespace and local
name.  I support the change, but suggest that the editors find some other phrasing
to make clear that what we care about is the expanded name of the element, not
its prefix.
Comment 2 Kirk Wilson 2007-12-06 19:23:17 UTC
+1 to proposal as amended by MSM in comment #2
Comment 3 Kumar Pandit 2007-12-07 03:17:57 UTC
I agree with the proposal in comment# 1.
Comment 4 Virginia Smith 2007-12-10 20:52:43 UTC
I agree with proposal in comment #1 with an additional suggestion for detecting errors. E.g., in the example would the SML validator regard 2 sml:uri elements as an error since the URI scheme specifies only 1 or would the validator regard this as an unknown scheme.
Comment 5 Sandy Gao 2007-12-13 18:32:41 UTC
To answer the question raised in comment #4.

The latter: it's not using the URI scheme, because the reference is not recognized as an instance of the URI scheme.

To avoid potential confusion, we could clarify that scheme implementations can only report errors for their recognized instances. For example, maybe in 4.3, after the 3 requirements, add something like: 

"A schema definition MAY impose additional requirements on references recognized as instances of the scheme. Such requirements, if any, MUST NOT be applied by scheme implementations to references that are not instances of the corresponding scheme."
Comment 6 Virginia Smith 2007-12-13 20:33:42 UTC
fix per original description as modified by comments.
Comment 7 Valentina Popescu 2007-12-18 19:11:00 UTC
URI definition, section 4.3.1, first bullet reads now :

1. An SML reference element is identified as using the SML URI scheme if and only if exactly one element information item whose [local name] is uri and whose [namespace name] is http://www.w3.org/@@@@/@@/sml is present as a child of that reference element.

To address comment #4 and #5 this paragraph was added at the end of section 4.3 Reference Schemes

http://dev.w3.org/cvsweb/~checkout~/2007/xml/sml/build/sml.html?content-type=text/html;%20charset=utf-8#Reference_Schemes

A schema definition MAY impose additional requirements on references recognized as instances of that scheme. Such requirements, if any, MUST NOT be applied by scheme implementations to references that are not instances of the corresponding scheme.