Re: Re[6]: [xml] bug with created attribute nodes?



On Thu, Dec 26, 2002 at 11:54:24AM +0300, Alexander Grimalovsky wrote:
 So, it mean that authors of PHP bindings for libxml2 just use wrong
API call for setting attribute value? If so, can you please point me
to a function, which should be used for setting attribute value
instead of xmlSetProp() ? So I will be able to write proper bugreport
for PHP.

  No. It just mean that the xmlSetProp API has that characteristic.

 It looks like this behaviour was changed sometime in the past... At
least following Perl example:

use XML::LibXML;
use strict;
[...]
 with XML::LibXML v1.53, libxml v1.8.17.

  If you use 1.8.17 I just don't want to hear about bug reports,
it's purely a compatibility library for teh legacy Gnome 1.x platform
and I have asked everybody else to use libxml2 for a couple of years at
least. Anyway I doubt XML::LibXML uses it.
  I do not control PHP and Perl bindings. I have no idea what they actually
do at the library interface, the only bindings I accept bug reports for is
the python one.
  Again the behaviour of xmlSetProp() may be strange, but I won't change
it. In the worse case if you prove me it makes things really hard I may
create a new API, but so far I am not convinced. I will not break the
existing applications based on your existing test case. More fundamentally
you seems to believe that attribute and text node content should be expected
to behave in the same way while this is definitely not true as dictated
by the XML specification, attribute values have restrictions, and are
modified by the parser before being passed to the application. 
  It's perfectly possible with the current API to change the attribute
to a given substring without using xmlSetProp(). An attribute has children
which are usually a single text node, possibly an alternance of text node
and entities reference, you can modify directly the content of the text
node children if the API behaviour doesn't suit you.

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]