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

Re: [xml] Question about error reporting when using key / keyref constraints in Schema



On Thu, Aug 11, 2005 at 03:31:50PM +0200, Kasimier Buchcik wrote:
> This is expected, but I understand that it does not help chasing
> instance errors.
> We changed the behaviour due to streaming validation. Keyrefs
> can be only examined when we have traversed all content of the element
> for which the keyref was defined (ELEMENTS in this case). I.e. we
> need a complete list of all existing key/unique values in the
> content to be able to say if a keyref has a correspondent.
> Since, for streaming validation, this would mean saving all target
> node informations - to be able to report the exact error prone node -
> until we are finished with the content, we would loose the profit of
> streaming validations: memory. Now, we could save the node
> information in the case where we don't use streaming validation,
> but this would result in different results for streaming/node-tree
> validation. I dunno if such an inconsistency is appropriate,
> so feedback from the list is mostly welcome.

  maybe the line of the reference can be saved at the same time of the
value, that's what I did for ID in DTD validation when streaming. And
it is sufficient for the error report you don't need to keep a pointer
to the node.

> By the way, I tested this with Xerces-J 2.7.1:
> 
> keyref.xml:7,12: (Error) Key 'keyref' with value 'test' not found for
> identity constraint of element 'ELEMENTS'.
> (the line number points to the end tag of ELEMENTS by the way) 
> 
> Xerces uses the same mechanism as we do.

  We can certainly improve over xerces user-friendlyness ;-)

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]