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 2207 - R-215: Whitespace and identity constraints
Summary: R-215: Whitespace and identity constraints
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.0 only
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: needsDrafting
: 4950 (view as bug list)
Depends on: 2229
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-14 19:11 UTC by Sandy Gao
Modified: 2011-10-21 16:39 UTC (History)
1 user (show)

See Also:


Attachments

Description Sandy Gao 2005-09-14 19:11:09 UTC
According to the errata:
http://www.w3.org/2001/05/xmlschema-errata.html#e1-6
whitespace is now allowed between tokens in xpaths. 

The patterns in the schema for schema have not been updated to reflect this. 

See:
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2003JanMar/0044.html
Comment 1 Sandy Gao 2005-09-14 19:11:16 UTC
Discussed at the 2003-08-31 telecon to classify as an error with erratum, and 
instruct the editors to fix the pattern.
Comment 2 Martin von Gagern 2007-08-15 11:57:44 UTC
*** Bug 4950 has been marked as a duplicate of this bug. ***
Comment 3 Martin von Gagern 2007-09-12 10:16:22 UTC
I would assume the following shell script should give correct patterns to fix both this issue here and bug 2122.

S="\\s*"
NCName='[^\I:][^\C:]*'
QName="${NCName}:${NCName}"
NameTest="(child::${S})?(${NCName}:)?(${NCName}|\\*)"
Step="${S}(\\.|${NameTest})${S}"
Path="(${S}\\.${S}//)?${Step}(/${Step})*"
Selector="${Path}(\\|${Path})*"
echo "selector: ${Selector}"
LastStep="${Step}|${S}(@|attribute::)${S}${NameTest}${S}"
Path="(${S}\\.${S}//)?(${Step}/)*(${LastStep})"
Selector="${Path}(\\|${Path})*"
echo "field: ${Selector}"

With some linebreaks added, the resulting patterns look as follows.

selector: 
(\s*\.\s*//)?\s*(\.|(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*))\s*
(/\s*(\.|(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*))\s*)*
(\|(\s*\.\s*//)?\s*(\.|(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*))\s*
(/\s*(\.|(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*))\s*)*)*

field: 
(\s*\.\s*//)?(\s*(\.|(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*))\s*/)*
(\s*(\.|(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*))\s*
|\s*(@|attribute::)\s*(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*)\s*)
(\|(\s*\.\s*//)?(\s*(\.|(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*))\s*/)*
(\s*(\.|(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*))\s*
|\s*(@|attribute::)\s*(child::\s*)?([^\I:][^\C:]*:)?([^\I:][^\C:]*|\*)\s*))*