From bf9c1dad3a7d17f9207756a5b0e3a3efdba34c1b Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 26 Aug 2008 07:46:42 +0000 Subject: [PATCH] add the testchar to 'make check' Volker Grabsch pointed out a typo * Makefile.am: add the testchar to 'make check' * xmlschemas.c: Volker Grabsch pointed out a typo * xmlregexp.c: production [19] from XML Schemas regexps were a mistake removed in version REC-xmlschema-2-20041028, Volker Grabsch provided a patch to remove it * test/schemas/regexp-char-ref_0.xml test/schemas/regexp-char-ref_0.xsd test/schemas/regexp-char-ref_1.xsd result/schemas/regexp-char-ref_0_0 result/schemas/regexp-char-ref_1_0: Volker Grabsch also provided regession tests for this Daniel svn path=/trunk/; revision=3776 --- ChangeLog | 12 ++++++ Makefile.am | 2 +- result/schemas/regexp-char-ref_0_0 | 1 + result/schemas/regexp-char-ref_1_0 | 1 + test/schemas/regexp-char-ref_0.xml | 7 ++++ test/schemas/regexp-char-ref_0.xsd | 20 ++++++++++ test/schemas/regexp-char-ref_1.xsd | 20 ++++++++++ xmlregexp.c | 64 ------------------------------ xmlschemas.c | 2 +- 9 files changed, 63 insertions(+), 66 deletions(-) create mode 100644 result/schemas/regexp-char-ref_0_0 create mode 100644 result/schemas/regexp-char-ref_1_0 create mode 100644 test/schemas/regexp-char-ref_0.xml create mode 100644 test/schemas/regexp-char-ref_0.xsd create mode 100644 test/schemas/regexp-char-ref_1.xsd diff --git a/ChangeLog b/ChangeLog index b3bcf55d..30997f5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Tue Aug 26 09:42:08 CEST 2008 Daniel Veillard + + * Makefile.am: add the testchar to 'make check' + * xmlschemas.c: Volker Grabsch pointed out a typo + * xmlregexp.c: production [19] from XML Schemas regexps were a + mistake removed in version REC-xmlschema-2-20041028, Volker Grabsch + provided a patch to remove it + * test/schemas/regexp-char-ref_0.xml test/schemas/regexp-char-ref_0.xsd + test/schemas/regexp-char-ref_1.xsd result/schemas/regexp-char-ref_0_0 + result/schemas/regexp-char-ref_1_0: Volker Grabsch also provided + regession tests for this + Tue Aug 26 09:25:39 CEST 2008 Daniel Veillard * include/libxml/parser.h xinclude.c xmllint.c: patch based on diff --git a/Makefile.am b/Makefile.am index dc06989d..f1e28636 100644 --- a/Makefile.am +++ b/Makefile.am @@ -172,7 +172,7 @@ runxmlconf_LDADD= $(LDADDS) #testOOM_LDADD= $(LDADDS) runtests: - $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) + $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) check: all runtests diff --git a/result/schemas/regexp-char-ref_0_0 b/result/schemas/regexp-char-ref_0_0 new file mode 100644 index 00000000..40ceb7fc --- /dev/null +++ b/result/schemas/regexp-char-ref_0_0 @@ -0,0 +1 @@ +./test/schemas/regexp-char-ref_0.xml validates diff --git a/result/schemas/regexp-char-ref_1_0 b/result/schemas/regexp-char-ref_1_0 new file mode 100644 index 00000000..40ceb7fc --- /dev/null +++ b/result/schemas/regexp-char-ref_1_0 @@ -0,0 +1 @@ +./test/schemas/regexp-char-ref_0.xml validates diff --git a/test/schemas/regexp-char-ref_0.xml b/test/schemas/regexp-char-ref_0.xml new file mode 100644 index 00000000..f6f463e0 --- /dev/null +++ b/test/schemas/regexp-char-ref_0.xml @@ -0,0 +1,7 @@ + + + diff --git a/test/schemas/regexp-char-ref_0.xsd b/test/schemas/regexp-char-ref_0.xsd new file mode 100644 index 00000000..2d91c6c6 --- /dev/null +++ b/test/schemas/regexp-char-ref_0.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/test/schemas/regexp-char-ref_1.xsd b/test/schemas/regexp-char-ref_1.xsd new file mode 100644 index 00000000..598a4d53 --- /dev/null +++ b/test/schemas/regexp-char-ref_1.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/xmlregexp.c b/xmlregexp.c index 54eb9576..73598a53 100644 --- a/xmlregexp.c +++ b/xmlregexp.c @@ -4906,64 +4906,6 @@ xmlFAParseCharClassEsc(xmlRegParserCtxtPtr ctxt) { } } -/** - * xmlFAParseCharRef: - * @ctxt: a regexp parser context - * - * [19] XmlCharRef ::= ( '&#' [0-9]+ ';' ) | (' &#x' [0-9a-fA-F]+ ';' ) - */ -static int -xmlFAParseCharRef(xmlRegParserCtxtPtr ctxt) { - int ret = 0, cur; - - if ((CUR != '&') || (NXT(1) != '#')) - return(-1); - NEXT; - NEXT; - cur = CUR; - if (cur == 'x') { - NEXT; - cur = CUR; - if (((cur >= '0') && (cur <= '9')) || - ((cur >= 'a') && (cur <= 'f')) || - ((cur >= 'A') && (cur <= 'F'))) { - while (((cur >= '0') && (cur <= '9')) || - ((cur >= 'a') && (cur <= 'f')) || - ((cur >= 'A') && (cur <= 'F'))) { - if ((cur >= '0') && (cur <= '9')) - ret = ret * 16 + cur - '0'; - else if ((cur >= 'a') && (cur <= 'f')) - ret = ret * 16 + 10 + (cur - 'a'); - else - ret = ret * 16 + 10 + (cur - 'A'); - NEXT; - cur = CUR; - } - } else { - ERROR("Char ref: expecting [0-9A-F]"); - return(-1); - } - } else { - if ((cur >= '0') && (cur <= '9')) { - while ((cur >= '0') && (cur <= '9')) { - ret = ret * 10 + cur - '0'; - NEXT; - cur = CUR; - } - } else { - ERROR("Char ref: expecting [0-9]"); - return(-1); - } - } - if (cur != ';') { - ERROR("Char ref: expecting ';'"); - return(-1); - } else { - NEXT; - } - return(ret); -} - /** * xmlFAParseCharRange: * @ctxt: a regexp parser context @@ -4985,12 +4927,6 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) { return; } - if ((CUR == '&') && (NXT(1) == '#')) { - end = start = xmlFAParseCharRef(ctxt); - xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg, - XML_REGEXP_CHARVAL, start, end, NULL); - return; - } cur = CUR; if (cur == '\\') { NEXT; diff --git a/xmlschemas.c b/xmlschemas.c index e8a603c9..03c0b02d 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -15092,7 +15092,7 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPCustomErr(ctxt, XML_SCHEMAP_ST_PROPS_CORRECT_1, WXS_BASIC_CAST type, NULL, - "A type, derived by list or union, must have" + "A type, derived by list or union, must have " "the simple ur-type definition as base type, not '%s'", xmlSchemaGetComponentQName(&str, baseType)); FREE_AND_NULL(str)