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



Hello Daniel,

Thursday, December 26, 2002, 1:50:24 PM, you wrote:

DV> 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.

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

 But since xmlSetProp() doesn't handle entities by itself, what will
be correct way of setting attribute value with handling embedded
entities? Should it be something like xmlNodeSetContentLen() ?

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

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

DV>   If you use 1.8.17 I just don't want to hear about bug reports,
DV> it's purely a compatibility library for teh legacy Gnome 1.x platform
DV> and I have asked everybody else to use libxml2 for a couple of years at
DV> least. Anyway I doubt XML::LibXML uses it.

 No, i don't use Perl for myself, it was just an example, posted in a
forum as response for my question. However same example with libxml2
v2.4.19 produces same output.

DV>   I do not control PHP and Perl bindings. I have no idea what they actually
DV> do at the library interface, the only bindings I accept bug reports for is
DV> the python one.
DV>   Again the behaviour of xmlSetProp() may be strange, but I won't change
DV> it. In the worse case if you prove me it makes things really hard I may
DV> create a new API, but so far I am not convinced. I will not break the
DV> existing applications based on your existing test case. More fundamentally
DV> you seems to believe that attribute and text node content should be expected
DV> to behave in the same way while this is definitely not true as dictated
DV> by the XML specification, attribute values have restrictions, and are
DV> modified by the parser before being passed to the application.

 No, I don't want to go so far, i just want to be sure that authors of
PHP bindings will be able to implement proper bindings for your
library. For now i get almost all necessary information to be able to
point them on it.

DV>   It's perfectly possible with the current API to change the attribute
DV> to a given substring without using xmlSetProp(). An attribute has children
DV> which are usually a single text node, possibly an alternance of text node
DV> and entities reference, you can modify directly the content of the text
DV> node children if the API behaviour doesn't suit you.

 Yes, i've checked your API already, thank you for information.

 
DV> Daniel


-- 
Best regards,
 Alexander                            mailto:flying dom natm ru





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