[xml] relaxng - false error message



Hi,

I got a false error message, using "xmlRelaxNGValidateDoc" with a 
relaxNG-schema + xml-file (located below).

xmllint:
--------
P:\tests\relaxNG\console\data>..\bin\xmllint --relaxng _s.rng _x.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<foo xmlns:aaa="aaa">
   <bar/>
   <bar/>
   <xxx/>
   <aaa:nsbar>
     <bar/>
   </aaa:nsbar>
</foo>
_x.xml:*4*: element bar: Relax-NG validity error : Element *foo has 
extra content: bar*
_x.xml fails to validate


I've testet this against the jing validator:

jing:
-----
P:\tests\relaxNG\console\data>jing -t _s.rng _x.xml
P:\tests\relaxNG\console\data\_x.xml:*5*: error: *unknown element "xxx"*


(Note that I marked the significant text with *).


schema:
-------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"; xmlns:aaa="aaa">
   <start>
      <element ns="" name="foo" >
       <choice>
         <element name="hallo">
           <empty/>
         </element>
          <ref name="content"/>
       </choice>
      </element>
   </start>

   <define name="content">
     <oneOrMore>
       <choice>

         <element name="bar">
           <empty/>
         </element>

         <element>
           <nsName ns="aaa"/>
           <zeroOrMore>
             <choice>
               <text/>
               <ref name="content"/>
             </choice>
           </zeroOrMore>
         </element>

       </choice>
     </oneOrMore>
   </define>

</grammar>


xml-file:
---------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns:aaa="aaa">
   <bar />
   <bar />
   <xxx />
   <aaa:nsbar >
     <bar  />
   </aaa:nsbar>
</foo>


- Both validators get happy if the element "xxx" is removed.


Is this a known malfunction?


Regards,


Kasimier




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