Skip to content

Conversation

@elementgreen
Copy link

Add a _parent member and a getParent() method to XmlNode.

This is convenient for traversing parent ancestry. However, it does break backwards compatibility with respect to the previous ability to add an XmlNode to multiple locations in the DOM. This change now enforces a 1 to 1 relationship between a parent and a child.

However, the ability to clone and duplicate XmlNode and derivative objects is a convenient way to attach the same content to different locations in the XML DOM and prevents surprises when content changes in multiple places from shared objects. PR #13 introduces this support and this PR depends on it.

…neCData,

  XmlPI.cloneXmlPI, XmlComment.cloneXmlComment, XmlDocument.cloneXmlDocument
Add XmlNode.duplicate for duplicating any XmlNode or derivatives
Add XmlNode.duplicate unittest
…d to one parent (breaks backwards compatibility)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant