html - XSLT Conversion - INNERHTML -


i posted question yesterday great success, did not give me needed more enough put me on right path. ran difficulty , hoping find similar guidance.

i have document several different types of elements, can nested within others. need remove tags , leave inner html whenever element present.

for example, if element pnum present, need take whole element , remove inner elements, leaving behind inner html.

input:

<li>     <pnum>      blah blah     <linum>hello hello</linum>     bye     <title>good morning</title>     </pnum> </li> 

output:

<li>     blah blah     hello hello     bye     morning <li> 

i able using htmlagilitypack, had traverse every node , performance not great. wondering if there quicker xslt transform can perform on doc.

thanks in advance!

i not sure have taken term innerhtml since ie 4 includes markup request strip markup not seem related innerhtml.

as xslt, can use

<xsl:template match="li[.//pnum]">   <xsl:copy>     <xsl:value-of select="."/>   </xsl:copy> </xsl:template> 

to have li element pnum descendant transformed li text contents.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -