Re: [xml] schema date handling



On Mon, Mar 31, 2003 at 10:54:22PM -0600, Charles Bozeman wrote:
While looking at your changes in the schema date parsing, I noticed some
oddities. You fixed the date_0.xsd file to have the correct gMonth
format for the <mon1> element but the content of <mon1> in date_0.xml is
incorrect (--05--) but not flagged as an error. 
Using gdb I traced through the code (xmlschemas.c) and found that
xmlSchemaValidatePredefinedType does return an error to
xmlSchemaValidateSimpleValue which returns an error to
xmlSchemaValidateSimpleContent which returns an error to
xmlSchemaValidateSimpleType which was called by xmlSchemaValidateContent
but does not check the return value. It appears xmlSchemaValidateContent
expects the ctxt->err to be set to some error value.

 Arghhh, 

Which routine should set the ctxt->err (to what value) and print an
error message.

  Good question, seem th earliest possible in the chain where the
context for error reporting is available should be the one, 
apparently xmlSchemaValidateSimpleValue()

A similar situation exists with xmlSchemaValidateBasicType which prints
an error message when a predefined type is invalid but it does not set
ctxt-err to any error value (what should the error value be?).

  XML_SCHEMAS_ERR_VALUE or a more specific one, adding it to 
xmlSchemaValidError if needed.

I know you are concentrating on relaxng validation so I will be happy to
create a patch if you can give me some direction on where to fix things.


   Go ahead, WXS conformance seems a far far away target, but we should
still try to fix bugs when some are raised.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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