re: [xml] Schema validity failure for valid document
- From: cazic gmx net
- To: xml gnome org
- Subject: re: [xml] Schema validity failure for valid document
- Date: Mon, 3 Jan 2005 04:15:07 +0100 (MET)
Hi,
(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
http://www.w3.org/2001/03/webdata/xsv 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'>
<complexType>
<sequence>
<element ref='cse:call_failure'/>
</sequence>
</complexType>
</element>
[...]
<call_event_sequence
xmlns='http://www.sipfoundry.org/sipX/schema/xml/cse-01-00'>
<call_event>
<observer>out1.sipxchange.example.com</observer>
<obs_seq>290</obs_seq>
<obs_time>2003-08-15T17:27:30.023Z</obs_time>
<call_failure>
<call>
<dialog>
<call_id>call-1036576858-13 10 1 1 252</call_id>
<from_tag>1c954235820</from_tag>
</dialog>
<from>"Scott"<sip:scott-ix kathmandu example >
com>;tag=1c954235820</from>
<to>Some Phone<sip:162 example com>transport=tcp</to>
</call>
</call_failure>
</call_event>
</call_event_sequence>
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.
Regards,
Kasimier
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]