re: [xml] Schema validity failure for valid document


(sorry this is a hand-made reply, so it might look funny)

On Fri, 31 Dec 2004 16:13:14 -0500 Scott Lawrence wrote:

I've attached a simplified version of a schema I'm working on and an
instance document that should validate against it.  I can't seem to
figure out how to get 'xmllint -schema' to accept this. 

I ran these same two documents through the LTG validator at and it accepts this document as
valid against the schema.

I've tried this both with version 2.6.16 (on FC2 linux) and with a
version built from CVS on 12/31/2004, both with the same result:
call_event_examples.xml:3: element call_event: Schemas validity error :
Element 'call_event' [CT local]: The element content is not valid.

There was a tiny enhancement in content model error reports in 
xmlschemas.c rev. 1.92; but since you builded as well from CVS on 
12/31/2004, you already noticed.


 <element name='call_event'>
            <element ref='cse:call_failure'/>

        <call_id>call-1036576858-13 10 1 1 252</call_id>
      <from>"Scott"&lt;sip:scott-ix kathmandu example > 
      <to>Some Phone&lt;sip:162 example com&gt;transport=tcp</to>

Sure there was a glitch in the simplification process of your 
schema/instance: it declares <call_failure> as the only child of 
<call_event>. Additionally the position of <to> and <from> in <call>
need to be swaped.
With this one I get:

P:\libxml2-lab\tests>xmllint --noout --schema test.xsd test.xml
Element 'observer': This element is not expected.
Element 'obs_seq': This element is not expected.
Element 'obs_time': This element is not expected.
Element 'call_failure': This element is not expected.
test.xml fails to validate

P:\libxml2-lab\tests>xmllint --version
xmllint: using libxml version 20616CVS2268
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer
XInclude Iconv MemDebug Unicode Regexps Automata Schemas

The error report: "Element 'call_failure': This element is not expected"
is due to the automaton context, which gets an "invalid" status on
the first non-matching element (<observer> in this case); this could
be fixed by resetting the status through a not yet existent API call 
(the regexp struct is not public).

Please resend the fixed schema/instance.



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