qiuwei / jing-trang

Automatically exported from code.google.com/p/jing-trang
Other
1 stars 1 forks source link

Wrong expected element in error reporting #80

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
test.rnc

start = test
test = element test { a, b* }
a = element a { x }
b = element b { empty }
x = element x { text }

test.xml

<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="test.rnc" type="compact"?>
<test>
    <a>
      <x></x>
    </a>
  <a>
    <b></b>
    <x></x>
  </a>
</test>

java -jar jing.jar -c test.rnc test.xml
/Users/george/Documents/workspace/jing/build/test.xml:7:6: error: element
"a" not allowed here; expected the element end-tag or element "b"
/Users/george/Documents/workspace/jing/build/test.xml:8:8: error: element
"b" not allowed here; expected element "b" or "x"

Note the second error message saying that b is not allowed but also
including it in the expected elements.

Original issue reported on code.google.com by georgebina76 on 9 Jun 2009 at 1:44

GoogleCodeExporter commented 8 years ago
The problem seems to be in the PossibleNamesFunction class that is reused and
different calls to applyTo(Pattern p) will reuse the same normalizer
(UnionNameClassNormalizer) that gets incorrect data from precious runs.

Original comment by georgebina76 on 18 Aug 2009 at 9:10

GoogleCodeExporter commented 8 years ago
Fixed in r2327 by resetting the normalizer name class in the applyTo method so 
that
information gathered during previous runs will be discarded.

Original comment by georgebina76 on 18 Aug 2009 at 9:53