I posted a question yesterday with great success, it did not exactly give me what I needed but certainly more than enough to put me on the right path. I ran into another difficulty and was hoping to find similar guidance.
I have a document with several different types of elements, some which can be nested within others. I need to remove all tags and leave only the inner HTML whenever a certain element is present.
For example, if the element pnum is present, I need to take the whole element and remove any inner elements, leaving behind only the inner html.
input:
<li>
<pnum>
blah blah
<linum>hello hello</linum>
good bye
<title>good morning</title>
</pnum>
</li>
output:
<li>
blah blah
hello hello
good bye
good morning
<li>
I was able to do this using HTMLAGILITYPACK, but I had to traverse every node and the performance is not great. I am wondering if there is a quicker XSLT transform I can perform on the doc.
Thanks in advance!