Re: [xml] xmlDOMWrapCloneNode problem

George Georgiev <george georgiev sf gmail com> writes:

int main(int argc, char **argv)
        xmlNodePtr mathPr = xmlNewDocNode(doc2, mns, BAD_CAST"mathPr", NULL);
        xmlDOMWrapCloneNode(NULL,                // xmlDOMWrapCtxtPtr - optional
                            mathFont->doc,       // sourceDoc (must not be NULL)
                            mathFont,            // node to clone
                            &newChildNode,       // destNode
                            mathPr->doc,         // destDoc
                            mathPr,              // destParent
                            TRUE,                // deep = clone children
                            0                    // options (ATTRIBUTE_UNUSED)

        xmlAddChild(root, mathPr);

The trouble seems to be using an unlinked node as destParent: if I do
xmlAddChild() before xmlDOMWrapCloneNode(), there are no problems. It
might be sensible for xmlDOMWrapCloneNode() to signal an error for this

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