You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2005/06/28 19:42:40 UTC
svn commit: r202252 -
/xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp
Author: amassari
Date: Tue Jun 28 10:42:39 2005
New Revision: 202252
URL: http://svn.apache.org/viewcvs?rev=202252&view=rev
Log:
Schema errata E2-67: allow unescaped '-' at the beginning and end of a regex
Modified:
xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp
Modified: xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp?rev=202252&r1=202251&r2=202252&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/regx/ParserForXMLSchema.cpp Tue Jun 28 10:42:39 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: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org