UweSchmidt / hxt

Haskell XML Toolbox

Home Page:http://www.fh-wedel.de/~si/HXmlToolbox/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Choice of element names gives hxt-relaxng the fits

blamario opened this issue · comments

commented

hxt-relaxng doesn't parse the following schema correctly:

<?xml version="1.0"?>
<element xmlns="http://relaxng.org/ns/structure/1.0">
  <choice>
    <name ns="">foo</name>
    <name ns="">bar</name>
  </choice>
  <element name="a">
    <empty/>
  </element>
  <element name="b">
    <empty/>
  </element>
</element>

If I run the HRelaxNG executable with this schema and a valid instance '' I get this error:

$ ./HRelaxNG v.xml c.rng 

error: when validating with Relax NG schema: Element with name NameClass Error: Can't create name class from element group expected, but foo found

What seems to be happening is that schema is silently parsed with invalid NCError name class instead of the foo|bar choice. The error message stored inside the NCError is "NameClass Error: Can't create name class from element group". It's substituted inside the above message.