Forums » Saxon/C Help and Discussions »
XdmNode::getParent()
Added by Paul Greve 3 days ago
Hi,
We're using SaxonC 12.5.0 to parse XML instance docs (DocumentBuilder::parseXmlFromString()). Does the object (XdmNode *) returned by XdmNode::getParent() need to be deleted? If I do delete it and then make a second call to getParent, I get a java.lang.IllegalArgumentException: Invalid handle exception when accessing the returned XdmNode. Just trying to implement proper memory management in our code.
Thanks, Paul Greve
Replies (2)
RE: XdmNode::getParent() - Added by O'Neil Delpratt 1 day ago
Hi Paul,
Yes this is a bug, which was fixed 6 months ago, but missed the 12.5.0 release. I have created a bug issue for it here: #6656 As a workaround avoid deleting the parent node if you intent to reuse it and only delete it when object no longer used. Alternatively, you can apply the bug fix to the C++ code yourself which is detailed in the bug issue.
RE: XdmNode::getParent() - Added by Paul Greve about 19 hours ago
Thanks O'Neill. No sure which way we'll go for now, workaround or code fix, but I'll take look at the fix in the bug report.
Please register to reply