W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2007

[Bug 2207] R-215: Whitespace and identity constraints

From: <bugzilla@wiggum.w3.org>
Date: Wed, 12 Sep 2007 10:16:22 +0000
CC:
To: www-xml-schema-comments@w3.org
Message-Id: <E1IVPGg-0006fI-Hs@wiggum.w3.org>

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





------- Comment #3 from Martin.vGagern@gmx.net  2007-09-12 10:16 -------
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*))*
Received on Wednesday, 12 September 2007 10:16:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:06 UTC