Author: amassari
Date: Tue Jun 28 10:43:15 2005
New Revision: 202254
URL: http://svn.apache.org/viewcvs?rev=202254&view=rev
Log:
Schema errata E2-67: allow unescaped '-' at the beginning and end of a regex
Modified:
xerces/c/branches/xerces-2.7/src/xercesc/util/regx/ParserForXMLSchema.cpp
Modified:
xerces/c/branches/xerces-2.7/src/xercesc/util/regx/ParserForXMLSchema.cpp
URL:
http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/util/regx/ParserForXMLSchema.cpp?rev=202254&r1=202253&r2=202254&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/util/regx/ParserForXMLSchema.cpp
(original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/util/regx/ParserForXMLSchema.cpp
Tue Jun 28 10:43:15 2005
@@ -200,6 +200,14 @@
if (!end) {
+ // handle '-' when appearing at the beginning of a positive
character group
+ if (firstLoop && !isNRange && type == REGX_T_CHAR && ch == chDash)
+ {
+ tok->addRange(chDash, chDash);
+ firstLoop=false;
+ continue;
+ }
+
if (type == REGX_T_CHAR
&& (ch == chOpenSquare
|| ch == chCloseSquare
@@ -218,8 +226,13 @@
if ((type = getState()) == REGX_T_EOF)
ThrowXMLwithMemMgr(ParseException,XMLExcepts::Parser_CC2,
getMemoryManager());
- if ((type == REGX_T_CHAR && getCharData() == chCloseSquare)
- || type == REGX_T_XMLSCHEMA_CC_SUBTRACTION) {
+ // handle '-' when appearing at the end of a positive
character group
+ if (!isNRange && type == REGX_T_CHAR && getCharData() ==
chCloseSquare) {
+ tok->addRange(ch, ch);
+ tok->addRange(chDash, chDash);
+ }
+ else if((type == REGX_T_CHAR && getCharData() == chCloseSquare)
+ || type == REGX_T_XMLSCHEMA_CC_SUBTRACTION) {
static const XMLCh dashStr[] = { chDash, chNull};
ThrowXMLwithMemMgr2(ParseException,
XMLExcepts::Parser_CC6, dashStr, dashStr, getMemoryManager());
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]