Re: [xml] xmlHasProp() returns attribute declaration for optional attribute s

On Mon, Jul 07, 2003 at 04:11:46PM +0200, Keim, Markus wrote:
Hello Daniel, hello @all,

well, as the subject says...
The reference for xmlHasProp() (and xmlHasNsProp()) says that
  "This function also looks in DTD attribute declaration for
  #FIXED or default declaration values unless DTD use has been
  turned off."
and i guess this (and *exactly* this) is the correct and
intended behaviour.
But if an attribute isn't specified at the requested node,
xmlHasProp() (resp. xmlHasNsProp()) does a lookup for a DTD
declaration calling xmlGetDtdAttrDesc() (resp.
xmlGetDtdQAttrDesc()) and therefore returns a non-null
attribute declaration if *any* declaration is found (that is,
also for #IMPLIED declarations w/o default).

If i'm right and this isn't the intended behaviour, i'd
suggest the attached patch that provides the documented
behaviour (it's against v2.5.7):

  Okay, makes sense, applied and commited to CVS,

    thanks a lot,


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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