[xml] relaxng error information



I have a recursive xml document structure which I am trying to validate
with relaxng.  I am having trouble with the error messages which
indicate an error in the outermost grammar start element, rather than
the innermost element of that same grammar, which is where the error
occurs.  Here's what I mean: given a document like this:

<x:a>
  <x:b/>
  <x:c>
    <x:d/
    <x:c>
      <x:d/>
      <x:d/>
      <x:c>
        <x:f/>
      </x:c>
    </x:c>
  <x:c>
</x:a>

which has an error in the definition of element x:f; an error is
reported in the content of x:b.

My rng definition looks something like:

<grammar>
  <define name=a>
    <optional>
      <ref name=b/>
    </optional>
    <ref name=elems/>
  </define>

  <define name=b/>

  <define elems>
    <zeroOrMore>
      <choice of x:c, x:d, x:e, x:f, etc/>
    </zeroOrMore>
  </define>

  <define c>
    <definition of c with recursive reference to elems/>
  </define>

  <!-- ditto for d, e, f, etc -->
</grammar>

I would really like the error to describe a problem in x:f but what I
get is: 
"element b: Relax-NG validity error : Element a has extra content: b"

Is this a bug or feature?  Are there any work-arounds?  I can provide
the actual files and an xmllint command if that will help.

This is on Debian lenny: libxml version 2.6.32.dfsg-5

__
Marc

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]