Remove HTML Tags

Here should go questions about transforming XML with XSLT and FOP.
Posts: 12
Joined: Fri Mar 02, 2012 12:11 am

Remove HTML Tags

Post by Marzipan » Tue Mar 20, 2012 4:20 pm

Would like assistance in modifying existing XSLT to call the template "RemoveHtmlTags", Here is the existing xsl file:

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:output method="xml" indent="no"/>

<xsl:template match="/|comment()|processing-instruction()">

<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*|node()"/>

<xsl:template match="@*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>

<!-- Removes levels with out data, easier to flatten and process in SSIS-->

<xsl:template match="*[contains(name(), 'Group')]">

<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>

<xsl:template name="removeHtmlTags">
<xsl:param name="html"/>
<xsl:when test="contains($html, '<')">
<xsl:value-of select="substring-before($html, '<')"/>
<!-- Recurse through HTML -->
<xsl:call-template name="removeHtmlTags">
<xsl:with-param name="html" select="substring-after($html, '>')"/>
<xsl:value-of select="$html"/>