Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have one html file. i want to clean up this html file(Remove all attributes) and get plain html file by using xslt

for that purpose I have written following xslt file

HTML
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="node()|@*" name="identity">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="@*"/>

</xsl:stylesheet>


I got proper result, but In my html file there is tag like

HTML
<a href="#_ftnref0_1" id="_ftnrefText0_1" class="Footnote"><sup>1</sup></a>
<a href="#_ftnref0_2" id="_ftnrefText0_2" class="Footnote"><sup>2</sup></a>


So when i applied this xslt file on html file that time i got this tag like as a

HTML
<a>
          <sup>1</sup>
        </a>

<a>
          <sup>2</sup>
        </a>


But i want this tag should be in following format using xslt.
HTML
<a class="Footnote"><sup>1</sup></a>
<a class="Footnote"><sup>2</sup></a>

please help me in that..

Thanks In Advance.

samadhan.
Posted
Comments
John C Rayan 21-Feb-15 6:39am    
Can you post your HTML too
John C Rayan 27-Feb-15 5:54am    
Have you fixed your problem?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900