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 3684 - [SCD] // confusing
Summary: [SCD] // confusing
Status: RESOLVED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: SCDS: XML Schema Component Designators (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Mary Holstege
QA Contact: XML Schema comments list
URL: http://lists.w3.org/Archives/Member/w...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-08 15:04 UTC by Mary Holstege
Modified: 2009-02-06 17:43 UTC (History)
0 users

See Also:


Attachments

Description Mary Holstege 2006-09-08 15:04:44 UTC
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"/>
Comment 1 Mary Holstege 2006-09-22 16:33:37 UTC
WG agreed to investigate the "run-away //" issue; in general don't 
feel that traversing all paths is a good idea.
Comment 2 Mary Holstege 2008-01-15 22:02:11 UTC
// now includes all components directly connected to the schema-as-a-whole, so //foo will match both global and local elements named "foo". 
Comment 3 Mary Holstege 2009-02-06 17:39:54 UTC
Fixed in Last Call draft http://www.w3.org/TR/2008/WD-xmlschema-ref-20081117/