[Bug 3684] [SCD] // confusing

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

           Summary: [SCD] // confusing
           Product: XML Schema
           Version: unspecified
          Platform: PC
               URL: http://lists.w3.org/Archives/Member/w3c-xml-schema-
                    wg/2006Aug/0016.html
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SCDS: XML Schema Component Designators
        AssignedTo: holstege@mathling.com
        ReportedBy: holstege@mathling.com
         QAContact: www-xml-schema-comments@w3.org


Originally raised in
http://lists.w3.org/Archives/Member/w3c-xml-schema-wg/2006Aug/0016.html by
Kohsuke Kawaguchi <Kohsuke.Kawaguchi@Sun.COM>

- The way the 'descendant axis' // works is unintuitive to me. For
   example, "//foo" doesn't match the following foo element because
   "//" only traverses the default axes, which doesn't include
   schem-as-a-whole -> complexType.

   <complexType name="type">
     <sequence>
       <element name="foo" ... />

   Given the syntactic similarity with XPath's "//", I suspect I'm not
   the only one to be surprised by this. I think it'll be more
   intuitive if "//" works more like XPath over schema document, since
   the XML representation of a schema document is what people use as
   their mental picture when they think about paths. IOW, I suggest
   changing default axes to match with XML syntax more closely.

   The above was an example of an unreachable component that's
   seemingly reachable, but there are examples of the other direction
   --- a seemingly unreachable component that's actually reachable. In
   the example below, "~type//foo" matches both global and local foo,
   not just the local one. I find this kind of run-away // unintuitive,
   too. As an user, if I wanted to match all foo everywhere, I'd
   probably write "//foo".

   <complexType name="type">
     <sequence>
       <elment name="foo"/>
       <group ref="myGroup" />

   <group name="myGroup">
     <sequence>
       <element name="bar">
         <complexType>
           <sequence>
             <element ref="foo"/>

   <element name="foo"/>

Received on Friday, 8 September 2006 15:05:12 UTC