home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _2F521ECA013F4F03BE6D1632D5FC0089 < prev    next >
Encoding:
Extensible Markup Language  |  2002-08-30  |  3.9 KB  |  127 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.                 version="1.0">
  4.  
  5. <xsl:output method="xml" encoding="US-ASCII"/>
  6. <xsl:preserve-space elements="*"/>
  7.  
  8. <xsl:template match="/">
  9.   <xsl:text> </xsl:text>
  10.   <xsl:comment>This file was created automatically by html2xhtml</xsl:comment>
  11.   <xsl:text> </xsl:text>
  12.   <xsl:comment>from the HTML stylesheets. Do not edit this file.</xsl:comment>
  13.   <xsl:text> </xsl:text>
  14.   <xsl:apply-templates/>
  15.   <xsl:text> </xsl:text>
  16. </xsl:template>
  17.  
  18. <!-- Make sure we override some templates and parameters appropriately for XHTML -->
  19. <xsl:template match="xsl:output">
  20.   <xsl:copy>
  21.     <xsl:copy-of select="@*"/>
  22.     <xsl:attribute name="method">xml</xsl:attribute>
  23.     <xsl:attribute name="doctype-public">-//W3C//DTD XHTML 1.0 Transitional//EN</xsl:attribute>
  24.     <xsl:attribute name="doctype-system">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</xsl:attribute>
  25.   </xsl:copy>
  26. </xsl:template>
  27.  
  28. <xsl:template match="xsl:param[@name='stylesheet.result.type']">
  29.   <xsl:copy>
  30.     <xsl:copy-of select="@*"/>
  31.     <xsl:attribute name="select">'xhtml'</xsl:attribute>
  32.   </xsl:copy>
  33. </xsl:template>
  34.  
  35. <xsl:template match="xsl:param[@name='make.valid.html']">
  36.   <xsl:copy>
  37.     <xsl:copy-of select="@*"/>
  38.     <xsl:attribute name="select">1</xsl:attribute>
  39.   </xsl:copy>
  40. </xsl:template>
  41.  
  42. <xsl:template match="xsl:param[@name='output.method']">
  43.   <xsl:copy>
  44.     <xsl:copy-of select="@*"/>
  45.     <xsl:attribute name="select">'xml'</xsl:attribute>
  46.   </xsl:copy>
  47. </xsl:template>
  48.  
  49. <xsl:template match="xsl:attribute[@name='name']">
  50.   <xsl:choose>
  51.     <xsl:when test="ancestor::a">
  52.       <xsl:copy>
  53.         <xsl:copy-of select="@*"/>
  54.         <xsl:attribute name="name">id</xsl:attribute>
  55.         <xsl:apply-templates/>
  56.       </xsl:copy>
  57.     </xsl:when>
  58.     <xsl:otherwise>
  59.       <xsl:copy>
  60.         <xsl:copy-of select="@*"/>
  61.         <xsl:apply-templates/>
  62.       </xsl:copy>
  63.     </xsl:otherwise>
  64.   </xsl:choose>
  65. </xsl:template>
  66.  
  67. <xsl:template match="xsl:element">
  68.   <!-- make sure literal xsl:element declarations propagate the right namespace -->
  69.   <xsl:copy>
  70.     <xsl:copy-of select="@*"/>
  71.     <xsl:attribute name="namespace">http://www.w3.org/1999/xhtml</xsl:attribute>
  72.     <xsl:apply-templates/>
  73.   </xsl:copy>
  74. </xsl:template>
  75.  
  76. <xsl:template match="xsl:template[@name='body.attributes']">
  77.   <xsl:copy>
  78.     <xsl:copy-of select="@*"/>
  79.     <xsl:text> </xsl:text>
  80.     <xsl:comment> no apply-templates; make it empty </xsl:comment>
  81.     <xsl:text> </xsl:text>
  82.   </xsl:copy>
  83. </xsl:template>
  84.  
  85. <!-- this only occurs in docbook.xsl to identify errors -->
  86. <xsl:template match="font">
  87.   <span class="ERROR" xmlns="http://www.w3.org/1999/xhtml">
  88.     <xsl:apply-templates/>
  89.   </span>
  90. </xsl:template>
  91.  
  92. <!-- this only occurs in docbook.xsl to identify errors -->
  93. <xsl:template match="a[@name]">
  94.   <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
  95.     <xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
  96.     <xsl:for-each select="@*">
  97.       <xsl:if test="local-name(.) != 'name'">
  98.         <xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
  99.       </xsl:if>
  100.     </xsl:for-each>
  101.     <xsl:apply-templates/>
  102.   </xsl:element>
  103. </xsl:template>
  104.  
  105. <xsl:template match="*">
  106.   <xsl:choose>
  107.     <xsl:when test="namespace-uri(.) = ''">
  108.       <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
  109.         <xsl:copy-of select="@*"/>
  110.         <xsl:apply-templates/>
  111.       </xsl:element>
  112.     </xsl:when>
  113.     <xsl:otherwise>
  114.       <xsl:copy>
  115.         <xsl:copy-of select="@*"/>
  116.         <xsl:apply-templates/>
  117.       </xsl:copy>
  118.     </xsl:otherwise>
  119.   </xsl:choose>
  120. </xsl:template>
  121.  
  122. <xsl:template match="comment()|processing-instruction()|text()">
  123.   <xsl:copy/>
  124. </xsl:template>
  125.  
  126. </xsl:stylesheet>
  127.