This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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"/>
WG agreed to investigate the "run-away //" issue; in general don't feel that traversing all paths is a good idea.
// now includes all components directly connected to the schema-as-a-whole, so //foo will match both global and local elements named "foo".
Fixed in Last Call draft http://www.w3.org/TR/2008/WD-xmlschema-ref-20081117/