Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XmlMerger: Rework Combine Text Nodes #943

Open
hohwille opened this issue Jan 16, 2025 · 0 comments
Open

XmlMerger: Rework Combine Text Nodes #943

hohwille opened this issue Jan 16, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@hohwille
Copy link
Member

hohwille commented Jan 16, 2025

In review of PR #912 we found a problematic edge-case here:

} else if (updateChild.getNodeType() == Node.TEXT_NODE || updateChild.getNodeType() == Node.CDATA_SECTION_NODE) {
if (!updateChild.getTextContent().isBlank()) {
replaceTextNode(targetElement, updateChild);
}
}

From the review:

Every non-empty text node will be replaced using this method and replace the text into the first non-blank text node.
So if you have
template: Text(text1) CDATA(text2) Text(text3)
workspace: Text(text4) CDATA(text5) Text(text6)
you will create

    iteration: Text(text1) CDATA(text5) Text(text6)
    iteration: Text(text2) CDATA(text5) Text(text6)
    iteration: Text(text3) CDATA(text5) Text(text6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant