<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://www.w3.org/1999/xhtml" 
  xmlns:c="http://java.sun.com/jsp/jstl/core"
  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:util="xalan://XalanUtil"
  extension-element-prefixes="util">

  <xsl:template match="h:*/@* | fmt:param/@value">
  	<xsl:attribute name="{local-name(.)}"><xsl:value-of select="util:escape(.)"/></xsl:attribute>
  </xsl:template>
  
  <xsl:template match="h:*/text() | c:*/text()">
    <xsl:choose>
      <xsl:when test="not(../@preprocess='false')">
        <xsl:value-of select="util:escape(.)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="."/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <xsl:template match="@*|node()" priority="-1">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

