Re: [xml] xmlSplitQName2 problem and patch



On Wed, Feb 18, 2004 at 08:27:35AM -0800, Aleksey Sanin wrote:
But why does this function return NULL in this case?
Shouldn't it return the passed in string (in the same
way as xmlBuildQName() function does)?

  Well, that's a serious API change. I would have to modify
all the places where I use xmlSplitQName2(). This means an
API breakage. Just change it the function, and try to run libxml2
and libxslt regression tests. I bet this will lead to various
crashes. Since the implementation of the function matches its
description, I find hard to change this. You can use another function
though, like for example xmlSplitQName3() .

The current 
code returns NULL in error case too and this makes
a confusion (IMHO).

  "Returns NULL if not a QName" in case of memory allocation
error, an xmlTreeErrMemory() error is raised.
  And xmlSplitQName3 voids the problem completely...

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]