XSLT remove child node result in empty parent node



I am new to XSLT and I followed the article below to implement my requirement. My requirement is to remove the parent node completely if a condition in the child node is met. Same as the article below.


deleting the parent node if child node is not present in xml using xslt


In reference to the example in the above article, I was able to remove the content under <car>. However, my source xml has a twist. The twist is that it has a namespace.


For example:


source xml



<car xmlns="urn:test:v2xml">
.....
</car>


output xml:



<car/>


In my implementation, the result was an empty car node in my XML output. I am expecting the car node to be completed removed but no matter what I tried, the empty car node remains in the output xml.


Is there a way to completely remove that car node? I suspect that my namespace has something to do with it because without the namespace, it works and the tag is completely removed.


No comments:

Post a Comment