[Bug 7096] New: clarifications needed for annotation mapping?

http://www.w3.org/Bugs/Public/show_bug.cgi?id=7096

           Summary: clarifications needed for annotation mapping?
           Product: XML Schema
           Version: 1.1 only
          Platform: Macintosh
        OS/Version: Mac System 9.x
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Structures: XSD Part 1
        AssignedTo: David_E3@VERIFONE.com
        ReportedBy: cmsmcq@blackmesatech.com
         QAContact: www-xml-schema-comments@w3.org
                CC: cmsmcq@blackmesatech.com


Reading the description of annotation mappings today, I
find myself uncertain about a couple aspects of this
design.

1 The first clause of the definition contains a note
reading:

    Note: As described above (earlier in this section),
    the {attributes} property of each Annotation
    component includes any attribute information items
    on the parent (and possibly ancestors) of the
    <annotation> element which have a [namespace name]
    different from the XSD namespace.

Reading this, I find myself asking "and possibly
ancestors? How am I to know whether ancestors are
included or not?"  I believe the answer is given in the
XML mapping tableau, which says that non-XSD attributes
are copied from the annotation element itself, from the
source-declaration element which maps to the component,
and from any intervening elements.  We could say that
again here and make the note read:

    Note: As noted above, the {attributes} property of
    each Annotation component includes all the
    attribute information items on the annotation
    element itself, on the XML element which represents
    (and maps to) the component being annotated, and on
    any intervening XML elements, if those attribute
    information items have [namespace names] different
    from the XSD namespace.

2 The second clause of the definition of annotation
mapping says that if there are any other non-XSD
attributes on any element E in the set of elements
being mapped, there will be an annotation component
with empty {application information} and empty {user
information}, which will carry the relevant attributes
from E.[attributes].

Consider the example 

 <xsd:complexType name="T23" my:color="green">
  <xsd:complexContent my:stone="diamond">
   <xsd:extension base="B:T23" my:dow="Tuesday">
    <xsd:sequence>
     <xsd:element ref="A:other"/>
    </xsd:sequence>
   </xsd:extension>
  </xsd:complexContent>
 </xsd:complexType>

Does the definition of annotation mapping mean that
there will be three annotation components on type T23,
A1, A2, and A3, with

  A1.{attributes} = { my:color='green' }
  A2.{attributes} = { my:stone='diamond' } 
  A3.{attributes} = { my:dow='Tuesday' }

Or will there be a single annotation component, with

  {attributes} = { my:color='green',
                   my:stone='diamond', 
                   my:dow='Tuesday' }

?  Clause 2 says

    2 If there are any attribute information items
      among the [attributes] of any element information
      item E in ES with a [namespace name] different
      from the XSD namespace, which are not included in
      the {attributes} of any Annotation from clause 1,
      then there is an Annotation component in AS whose
      {application information} and {user information}
      are the empty sequence and whose {attributes}
      contains all and only such attribute information
      items among E.[attributes].

The words "then there is an Annotation component in AS
...  whose {attributes} contains" the otherwise
homeless attributes would seem to suggest there should
be one annotation.  

The words "whose {attributes} contains all and only
such attribute information items among E.[attributes]",
on the other hand, suggest to this reader a different
annotation compnent for each E in the element set which
carries non-XSD attributes.

The answer will matter for a SCDs test which asks for

  /type::T23/annotation[2]

Trying to find wording less susceptible to
misunderstanding, I suggest the following two
alternatives for consideration:

Plan A:  

    2 If any element item E in ES has any attribute
      information items A such that all of the following
      are true:

        2.1 A is in E.[attributes] 
        2.2 A.[namespace name] is present and not the
            XSD namespace
        2.3 A is not included in the {attributes} property
            of any annotation component described in
            clause 1

      then for each such E, an Annotation component C
      will appear in AS, with C.{application
      information} and C.{user information} being the
      empty sequence and C.{attributes} containing all
      and only those attribute information items A
      among E.[attributes].


Plan B:  

    2 If any element items E in ES have any attribute
      information items A such that all of the following
      are true:

        2.1 A is in E.[attributes] for some E in ES
        2.2 A.[namespace name] is present and not the
            XSD namespace
        2.3 A is not included in the {attributes} property
            of any annotation component described in
            clause 1

      then one Annotation component C will appear in
      AS, with C.{application information} and C.{user
      information} being the empty sequence and
      C.{attributes} containing all and only those
      attribute information items A.  

         Note:  if the attribute information items in
         C.{attributes} originate on different elements
         in ES, they are not guaranteed to have
         distinct names.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 10 July 2009 21:53:10 UTC