Re: [xml] validate by schema works but only after reparsing ?



On Tue, Jul 08, 2003 at 02:03:29PM +0200, Peter Sobisch wrote:
Hi Daniel,

On Tue, Jul 08, 2003 at 07:16:13AM -0400, Daniel Veillard wrote:
It is intentional behaviour storing line numbers into content ?
  yes, that's the only way I could add this feature.

ok, I looked over the xmlschemas.c and found this:

xmlschemas.c/xmlSchemaValidateType():
...
5416    if ((elem->content == NULL) || (type == NULL) || (elemDecl == NULL))
5417        return(0);
...

I removed the part '(elem->content == NULL)' for testing and the validation
worked as expected (without need xml file to be reparsed):

xmlschemas.c/xmlSchemaValidateType():
...
5416    if ((type == NULL) || (elemDecl == NULL))
5417        return(0);
...

But, I don't know which functionality will be affected by removing this item,
I assume this was there because of a good reason.

  hum, that was just wrong. Test should be
    if ((elem == NULL) || (type == NULL) || (elemDecl == NULL))
the actual content is stored in the children list as looked at later in that
routine.

  Thanks for going through the code and finding this, fix propagated to CVS !

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]