Hi there,

I do have a question related to the merging of text nodes when using 
xmlAddNextSibling. Many thanks in advance for any help.

The situation the the following: I already got two child nodes:

Comment1 with name "comment" and XML_COMMENT_NODE type
and 
Text1 with name "text" and XML_TEXT_NODE type

When I am inserting node 
Text2 with name "text" and XML_TEXT_NODE type 
 with xmlAddNextSibling.( Comment1, Text2), the TextNodes Text1 and Text2 
are not merged. I would have expected them to be merged into one node.

When I look at tree.c in function  xmlAddNextSibling, the case where the 
cur and elem node are TextNodes is handled first (not the case here) and 
the next case should be that cur->next and elem are TextNodes. However, 
the (cur->name == cur->next->name) clause prevents the merge. These are 
"comment" and "text" in this case.

Have I misunderstood the need to merge the two TextNodes in this case? Why 
is there a comparision of the names in the first place? I would have 
assumed comparing the node types would be sufficient.

Any help would be very welcome.

Cheers

Uwe

i.A. Dr. Uwe Köhler

Tel.: +49 (0) 251 490 943 17
OneVision Software Entwicklungs GmbH & Co. KG
Servatiiplatz 7-9 – 48143 Münster
Sitz der Gesellschaft: Regensburg
Persönlich haftende Gesellschafterin:
OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Strasse 9, 93049 Regensburg
Sitz der Gesellschaft: Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg
Geschäftsführer: Dr. Patrick Herzog, Andreas Besser

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to