This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 244308 - Allow zero schema documents to be bound to an instance document
Summary: Allow zero schema documents to be bound to an instance document
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Cosmos (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: amehrega CLA
QA Contact: amehrega CLA
URL: http://www.w3.org/Bugs/Public/show_bu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-15 10:59 EDT by John Arwe CLA
Modified: 2012-01-03 13:54 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arwe CLA 2008-08-15 10:59:09 EDT
This is a spec compliance issue, now that the working group has consensus.  From SML bug 5922's resolution:

add a new <noSchemaBinding> sub element under <schemaBindings>.
It contains any number of <documentAlias> elements. If an instance document
matches one of the <documentAlias>, then the default schema doesn't apply to it.

The editor's draft contains the new text and schema changes, and there is a diff for this change in the bug comment cited above (SML 5922 comment 3).

A second change made in the same SML bug (called "proposal 2)"), after discussion in later comments, results in no difference in behavior for existing implementations.
Comment 1 David Whiteman CLA 2008-08-15 16:39:08 EDT
Need to handle http://www.w3.org/Bugs/Public/show_bug.cgi?id=5923, where all schema documents must be examined for errors in construction, even if bound to 0 instances
Comment 2 amehrega CLA 2008-08-18 10:35:56 EDT
Added logic to handle noSchemaBinding element.
Test case:

<?xml version="1.0" encoding="UTF-8"?>
<!--

  Copyright (c) 2008 IBM Corporation.
  All rights reserved. This program and the accompanying materials
  are made available under the terms of the Eclipse Public License v1.0
  which accompanies this distribution, and is available at
  http://www.eclipse.org/legal/epl-v10.html
 
  Contributors:
     IBM Corporation - initial API and implementation 
-->
<model xmlns="http://www.w3.org/2008/09/sml-if" schemaComplete="true">
  <identity>
    <name>NoSchemaBinding</name>
    <baseURI>
		http://interop.serviceml.org
	</baseURI>
    <description>This SML-IF document is composed of two schema documents, S1 &amp; S2,
    			 and three instance documents, I1, I2, &amp; I3.  &lt;S1, I1, I2, I3&gt; is a 
    			 valid set whereas &lt;S2, I1, I2, I3&gt; is invalid.  The default binding is used
    			 to bind S2 with I1, I2, and I3 but the no schema binding element is used to 
    			 cancel out this binding.  The document should thus be evaluated as valid.
    </description>
  </identity>
  
  <schemaBindings>
    <defaultSchema>
        <namespaceBinding aliases="S2" namespace="university"/>       
    </defaultSchema>
    <noSchemaBinding>
    	<documentAlias>Course1</documentAlias>
    	<documentAlias>Course2</documentAlias>
    	<documentAlias>Course3</documentAlias>
    </noSchemaBinding>
  </schemaBindings>
  
  <definitions>
    <document>
      <docinfo>
        <aliases>
          <alias>S1</alias>
        </aliases>
      </docinfo>
      <data> 
        <xs:schema elementFormDefault="qualified" targetNamespace="university" xmlns:sml="http://www.w3.org/2008/09/sml" xmlns:tns="university" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:complexType name="OptionalCourseRefType">
          	<xs:sequence>
				<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
			</xs:sequence>         
          	<xs:anyAttribute namespace="##any" processContents="lax"/>
          </xs:complexType>

           <xs:complexType name="RequiredCourseRefType">
            <xs:complexContent>
              <xs:extension base="tns:OptionalCourseRefType"/>
            </xs:complexContent>
          </xs:complexType>

          <xs:element name="Course" type="tns:CourseType"/>
          <xs:element name="Courses">
            <xs:complexType>
              <xs:sequence>
                <xs:element maxOccurs="unbounded" minOccurs="0" name="Course" type="tns:CourseType"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>

          <xs:complexType name="CourseType">
            <xs:sequence>
              <xs:element name="Name" type="xs:string"/>
              <xs:element maxOccurs="unbounded" minOccurs="0" name="OptionalPreRequisite" type="tns:OptionalCourseRefType"/>
              <xs:element maxOccurs="unbounded" minOccurs="0" name="RequiredPreRequisite" type="tns:RequiredCourseRefType"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
      </data>
    </document>
    <document>
      <docinfo>
        <aliases>
          <alias>S2</alias>
        </aliases>
      </docinfo>
      <data> 
        <xs:schema elementFormDefault="qualified" targetNamespace="university" xmlns:sml="http://www.w3.org/2008/09/sml" xmlns:tns="university" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:complexType name="OptionalCourseRefType" sml:acyclic="true">
          	<xs:sequence>
				<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
			</xs:sequence>         
          	<xs:anyAttribute namespace="##any" processContents="lax"/>
          </xs:complexType>

           <xs:complexType name="RequiredCourseRefType">
            <xs:complexContent>
              <xs:extension base="tns:OptionalCourseRefType"/>
            </xs:complexContent>
          </xs:complexType>

          <xs:element name="Course" type="tns:CourseType"/>
          <xs:element name="Courses">
            <xs:complexType>
              <xs:sequence>
                <xs:element maxOccurs="unbounded" minOccurs="0" name="Course" type="tns:CourseType"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>

          <xs:complexType name="CourseType">
            <xs:sequence>
              <xs:element name="Name" type="xs:string"/>
              <xs:element maxOccurs="unbounded" minOccurs="0" name="OptionalPreRequisite" type="tns:OptionalCourseRefType"/>
              <xs:element maxOccurs="unbounded" minOccurs="0" name="RequiredPreRequisite" type="tns:RequiredCourseRefType"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
      </data>
    </document>
  </definitions>
  <instances>
    <document>
      <docinfo>
        <aliases>
          <alias>Course1</alias>
        </aliases>
      </docinfo>
      <data> 
        <Course xmlns="university" xmlns:sml="http://www.w3.org/2008/09/sml"> 
          <Name>Course1</Name>
          <RequiredPreRequisite sml:ref="true">
            <sml:uri>Course2</sml:uri>
          </RequiredPreRequisite>
        </Course>
      </data>
    </document>
    <document>
      <docinfo> 
        <aliases>
          <alias>Course2</alias>
        </aliases>
      </docinfo>
      <data>
        <Course xmlns="university" xmlns:sml="http://www.w3.org/2008/09/sml">
          <Name>Course2</Name>
          <OptionalPreRequisite sml:ref="true">
            <sml:uri>Course3</sml:uri>
          </OptionalPreRequisite>
        </Course>
      </data>
    </document>
    <document>
      <docinfo> 
        <aliases>
          <alias>Course3</alias>
        </aliases>
      </docinfo>
      <data>
        <Course xmlns="university" xmlns:sml="http://www.w3.org/2008/09/sml">
          <Name>Course3</Name>
          <OptionalPreRequisite sml:ref="true">
            <sml:uri>Course1</sml:uri>
          </OptionalPreRequisite>
        </Course>
      </data>
    </document>
  </instances>
</model>
Comment 3 David Whiteman CLA 2008-11-05 14:59:18 EST
closing to cleanup bugzilla