Commit 63d68a37 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

fixed a problem in Relax-NG validation #159968 added the test to the

* relaxng.c: fixed a problem in Relax-NG validation #159968
* test/relaxng/list.* result/relaxng/list_*: added the test
  to the regression suite
Daniel
parent f2531afe
Thu Mar 31 15:36:52 CEST 2005 Daniel Veillard <daniel@veillard.com>
* relaxng.c: fixed a problem in Relax-NG validation #159968
* test/relaxng/list.* result/relaxng/list_*: added the test
to the regression suite
Thu Mar 31 13:06:02 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
* python/libxml.c: fixed bug #168504
......
......@@ -6129,11 +6129,18 @@ xmlRelaxNGCheckRules(xmlRelaxNGParserCtxtPtr ctxt,
ret = XML_RELAXNG_CONTENT_EMPTY;
if ((cur->type == XML_RELAXNG_REF) ||
(cur->type == XML_RELAXNG_PARENTREF)) {
/*
* This should actually be caught by list//element(ref) at the
* element boundaries, c.f. Bug #159968 local refs are dropped
* in step 4.19.
*/
#if 0
if (flags & XML_RELAXNG_IN_LIST) {
xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_LIST_REF,
"Found forbidden pattern list//ref\n", NULL,
NULL);
}
#endif
if (flags & XML_RELAXNG_IN_DATAEXCEPT) {
xmlRngPErr(ctxt, cur->node, XML_RNGP_PAT_DATA_EXCEPT_REF,
"Found forbidden pattern data/except//ref\n",
......
./test/relaxng/list_0.xml validates
./test/relaxng/list_1.xml:1: element elem1: Relax-NG validity error : Element elem1 failed to validate attributes
./test/relaxng/list_1.xml fails to validate
./test/relaxng/list.rng validates
<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<define name="pattern1">
<data type="string">
<param name="pattern">-?([0-9]+(\.[0-9]*)?|\.[0-9]+)</param>
</data>
</define>
<start>
<element name="elem1">
<attribute name="attr1">
<list>
<ref name="pattern1"/>
</list>
</attribute>
</element>
</start>
</grammar>
<elem1 attr1="0"/>
<elem1 attr1="a"/>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment