Re: [xml] xmlSplitQName2 problem and patch

Ok, I got it. I think I'll just use this function in the same way you do it
(i.e. if it returns NULL then assume that there is no prefix).

Thanks for explanations!

Daniel Veillard wrote:
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...



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