Code Search for Developers
 
 
  

html2xhtml.xsl from Amavisd-new Maintenance at Krugle


Show html2xhtml.xsl syntax highlighted

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:exsl="http://exslt.org/common"
                exclude-result-prefixes="exsl"
                version="1.0">

<xsl:include href="http://docbook.sourceforge.net/release/xsl/current/lib/lib.xsl"/>
<xsl:output method="xml" encoding="US-ASCII"/>
<xsl:preserve-space elements="*"/>

<xsl:template match="/">
  <xsl:text>&#10;</xsl:text>
  <xsl:comment>This file was created automatically by html2xhtml</xsl:comment>
  <xsl:text>&#10;</xsl:text>
  <xsl:comment>from the HTML stylesheets. Do not edit this file.</xsl:comment>
  <xsl:text>&#10;</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>&#10;</xsl:text>
</xsl:template>

<xsl:template match="xsl:stylesheet" >
  <xsl:variable name="a">
      <xsl:element name="dummy" namespace="http://www.w3.org/1999/xhtml"/>
  </xsl:variable>
    <xsl:copy>
      <xsl:copy-of select="exsl:node-set($a)//namespace::*"/>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
   </xsl:copy>
</xsl:template>

<!-- Make sure we override some templates and parameters appropriately for XHTML -->
<xsl:template match="xsl:output">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="method">xml</xsl:attribute>
    <xsl:attribute name="encoding">UTF-8</xsl:attribute>
    <xsl:attribute name="doctype-public">-//W3C//DTD XHTML 1.0 Transitional//EN</xsl:attribute>
    <xsl:attribute name="doctype-system">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:import">
  <xsl:copy>
    <xsl:attribute name="href">
      <xsl:call-template name="string.subst">
        <xsl:with-param name="string" select="@href"/>
        <xsl:with-param name="target">/html/</xsl:with-param>
        <xsl:with-param name="replacement">/xhtml/</xsl:with-param>
      </xsl:call-template>
    </xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:param[@name='stylesheet.result.type']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="select">'xhtml'</xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:param[@name='make.valid.html']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="select">1</xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:param[@name='output.method']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="select">'xml'</xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:param[@name='chunker.output.method']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="select">'xml'</xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:param[@name='chunker.output.encoding']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="select">'UTF-8'</xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:param[@name='chunker.output.doctype-public']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="select">'-//W3C//DTD XHTML 1.0 Transitional//EN'</xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:param[@name='chunker.output.doctype-system']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="select">'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'</xsl:attribute>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:attribute[@name='name']">
  <xsl:choose>
    <xsl:when test="ancestor::a">
      <xsl:copy>
        <xsl:copy-of select="@*"/>
        <xsl:attribute name="name">id</xsl:attribute>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:when>
    <xsl:otherwise>
      <xsl:copy>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template match="xsl:element">
  <!-- make sure literal xsl:element declarations propagate the right namespace -->
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="namespace">http://www.w3.org/1999/xhtml</xsl:attribute>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="xsl:template[@name='body.attributes']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:text>&#10;</xsl:text>
    <xsl:comment> no apply-templates; make it empty </xsl:comment>
    <xsl:text>&#10;</xsl:text>
  </xsl:copy>
</xsl:template>

<!-- this only occurs in docbook.xsl to identify errors -->
<xsl:template match="font">
  <span class="ERROR" xmlns="http://www.w3.org/1999/xhtml">
    <xsl:apply-templates/>
  </span>
</xsl:template>

<!-- this only occurs in docbook.xsl to identify errors -->
<xsl:template match="a[@name]">
  <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
    <xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
    <xsl:for-each select="@*">
      <xsl:if test="local-name(.) != 'name'">
        <xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
      </xsl:if>
    </xsl:for-each>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>

<xsl:template match="*">
  <xsl:choose>
    <xsl:when test="namespace-uri(.) = ''">
      <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates/>
      </xsl:element>
    </xsl:when>
    <xsl:otherwise>
      <xsl:copy>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

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

</xsl:stylesheet>




See more files for this project here

Amavisd-new Maintenance

AmavisAdmin is a tool to maintain SPAMs, Viruses and blocked mails written to an SQL database by Amavisd-new. Mails can be removed automatically or manually, or they can be released to be send to the recipients.

Project homepage: http://sourceforge.net/projects/amavisadmin
Programming language(s): Java,XML
License: other

  admon.xsl
  annotations.xsl
  autoidx-kimber.xsl
  autoidx-kosek.xsl
  autoidx-ng.xsl
  autoidx.xsl
  autotoc.xsl
  biblio.xsl
  block.xsl
  callout.xsl
  changebars.xsl
  chunk-code.xsl
  chunk-common.xsl
  chunk.xsl
  chunker.xsl
  chunkfast.xsl
  chunktoc.xsl
  component.xsl
  db5strip.xsl
  division.xsl
  docbook.xsl
  docbookng.xsl
  ebnf.xsl
  footnote.xsl
  formal.xsl
  glossary.xsl
  graphics.xsl
  highlight.xsl
  html-rtf.xsl
  html.xsl
  html2xhtml.xsl
  htmltbl.xsl
  index.xsl
  info.xsl
  inline.xsl
  keywords.xsl
  lists.xsl
  maketoc.xsl
  manifest.xsl
  math.xsl
  oldchunker.xsl
  onechunk.xsl
  param.xsl
  pi.xsl
  profile-chunk-code.xsl
  profile-chunk.xsl
  profile-docbook.xsl
  profile-onechunk.xsl
  qandaset.xsl
  refentry.xsl
  sections.xsl
  synop.xsl
  table.xsl
  task.xsl
  titlepage.templates.xsl
  titlepage.xsl
  toc.xsl
  verbatim.xsl
  xref.xsl