Remove node if item is null #434
Unanswered
andrepaulo-bit
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Can you please explain with example? |
Beta Was this translation helpful? Give feedback.
3 replies
-
I had same problem and what ended doing was running using RegExp to solve it: function removeEmptyNodesFromXML(xmlString) {
const emptyNodesPattern = new RegExp(/(<[\w]+><[\w]+\/><\/[\w]+>)|(<[\w]+\/>)/gi);
const cleanedXmlString = xmlString.replace(emptyNodesPattern, '');
return cleanedXmlString;
} This will remove any |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I was wondering if it's possible to remove a node if the value its null.
I had a look at suppressEmptyNode but it doesn't seem like it solves my issue.
Saw this issue: #123
And that would work as well, but there are a few values that can be null, and I'm not sure how I can do that for every value.
Beta Was this translation helpful? Give feedback.
All reactions