home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _45C3198406434AF8A69BB66F40B366CF < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-04  |  15.9 KB  |  274 lines

  1. <?xml version="1.0" encoding="US-ASCII"?>
  2. <!--This file was created automatically by html2xhtml-->
  3. <!--from the HTML stylesheets. Do not edit this file.-->
  4. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect" xmlns:exsl="http://exslt.org/common" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" version="1.1" exclude-result-prefixes="doc" extension-element-prefixes="saxon xalanredirect lxslt exsl">
  5.  
  6. <!-- This stylesheet works with XSLT implementations that support -->
  7. <!-- exsl:document, saxon:output, or xalanredirect:write -->
  8. <!-- Note: Only Saxon 6.4.2 or later is supported. -->
  9.  
  10. <xsl:param name="chunker.output.method" select="'html'"/>
  11. <xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
  12. <xsl:param name="chunker.output.indent" select="'no'"/>
  13. <xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/>
  14. <xsl:param name="chunker.output.standalone" select="'no'"/>
  15. <xsl:param name="chunker.output.doctype-public" select="''"/>
  16. <xsl:param name="chunker.output.doctype-system" select="''"/>
  17. <xsl:param name="chunker.output.media-type" select="''"/>
  18. <xsl:param name="chunker.output.cdata-section-elements" select="''"/>
  19.  
  20. <xsl:param name="saxon.character.representation" select="'entity;decimal'"/>
  21.  
  22. <!-- ==================================================================== -->
  23.  
  24. <xsl:template name="make-relative-filename">
  25.   <xsl:param name="base.dir" select="'./'"/>
  26.   <xsl:param name="base.name" select="''"/>
  27.  
  28.   <xsl:choose>
  29.     <!-- put Saxon first to work around a bug in libxslt -->
  30.     <xsl:when test="element-available('saxon:output')">
  31.       <!-- Saxon doesn't make the chunks relative -->
  32.       <xsl:value-of select="concat($base.dir,$base.name)"/>
  33.     </xsl:when>
  34.     <xsl:when test="element-available('exsl:document')">
  35.       <!-- EXSL document does make the chunks relative, I think -->
  36.       <xsl:choose>
  37.         <xsl:when test="count(parent::*) = 0">
  38.           <xsl:value-of select="concat($base.dir,$base.name)"/>
  39.         </xsl:when>
  40.         <xsl:otherwise>
  41.           <xsl:value-of select="$base.name"/>
  42.         </xsl:otherwise>
  43.       </xsl:choose>
  44.     </xsl:when>
  45.     <xsl:when test="element-available('xalanredirect:write')">
  46.       <!-- Xalan doesn't make the chunks relative -->
  47.       <xsl:value-of select="concat($base.dir,$base.name)"/>
  48.     </xsl:when>
  49.     <xsl:otherwise>
  50.       <xsl:message terminate="yes">
  51.         <xsl:text>Don't know how to chunk with </xsl:text>
  52.         <xsl:value-of select="system-property('xsl:vendor')"/>
  53.       </xsl:message>
  54.     </xsl:otherwise>
  55.   </xsl:choose>
  56. </xsl:template>
  57.  
  58. <xsl:template name="write.chunk">
  59.   <xsl:param name="filename" select="''"/>
  60.   <xsl:param name="quiet" select="0"/>
  61.  
  62.   <xsl:param name="method" select="$chunker.output.method"/>
  63.   <xsl:param name="encoding" select="$chunker.output.encoding"/>
  64.   <xsl:param name="indent" select="$chunker.output.indent"/>
  65.   <xsl:param name="omit-xml-declaration" select="$chunker.output.omit-xml-declaration"/>
  66.   <xsl:param name="standalone" select="$chunker.output.standalone"/>
  67.   <xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
  68.   <xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
  69.   <xsl:param name="media-type" select="$chunker.output.media-type"/>
  70.   <xsl:param name="cdata-section-elements" select="$chunker.output.cdata-section-elements"/>
  71.  
  72.   <xsl:param name="content"/>
  73.  
  74.   <xsl:if test="$quiet = 0">
  75.     <xsl:message>
  76.       <xsl:text>Writing </xsl:text>
  77.       <xsl:value-of select="$filename"/>
  78.       <xsl:if test="name(.) != ''">
  79.         <xsl:text> for </xsl:text>
  80.         <xsl:value-of select="name(.)"/>
  81.         <xsl:if test="@id">
  82.           <xsl:text>(</xsl:text>
  83.           <xsl:value-of select="@id"/>
  84.           <xsl:text>)</xsl:text>
  85.         </xsl:if>
  86.       </xsl:if>
  87.     </xsl:message>
  88.   </xsl:if>
  89.  
  90.   <xsl:choose>
  91.     <xsl:when test="element-available('exsl:document')">
  92.       <xsl:choose>
  93.         <!-- Handle the permutations ... -->
  94.         <xsl:when test="$media-type != ''">
  95.           <xsl:choose>
  96.             <xsl:when test="$doctype-public != '' and $doctype-system != ''">
  97.               <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" standalone="{$standalone}">
  98.                 <xsl:copy-of select="$content"/>
  99.               </exsl:document>
  100.             </xsl:when>
  101.             <xsl:when test="$doctype-public != '' and $doctype-system = ''">
  102.               <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-public="{$doctype-public}" standalone="{$standalone}">
  103.                 <xsl:copy-of select="$content"/>
  104.               </exsl:document>
  105.             </xsl:when>
  106.             <xsl:when test="$doctype-public = '' and $doctype-system != ''">
  107.               <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-system="{$doctype-system}" standalone="{$standalone}">
  108.                 <xsl:copy-of select="$content"/>
  109.               </exsl:document>
  110.             </xsl:when>
  111.             <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
  112.               <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" standalone="{$standalone}">
  113.                 <xsl:copy-of select="$content"/>
  114.               </exsl:document>
  115.             </xsl:otherwise>
  116.           </xsl:choose>
  117.         </xsl:when>
  118.         <xsl:otherwise>
  119.           <xsl:choose>
  120.             <xsl:when test="$doctype-public != '' and $doctype-system != ''">
  121.               <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" standalone="{$standalone}">
  122.                 <xsl:copy-of select="$content"/>
  123.               </exsl:document>
  124.             </xsl:when>
  125.             <xsl:when test="$doctype-public != '' and $doctype-system = ''">
  126.               <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-public="{$doctype-public}" standalone="{$standalone}">
  127.                 <xsl:copy-of select="$content"/>
  128.               </exsl:document>
  129.             </xsl:when>
  130.             <xsl:when test="$doctype-public = '' and $doctype-system != ''">
  131.               <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-system="{$doctype-system}" standalone="{$standalone}">
  132.                 <xsl:copy-of select="$content"/>
  133.               </exsl:document>
  134.             </xsl:when>
  135.             <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
  136.               <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" standalone="{$standalone}">
  137.                 <xsl:copy-of select="$content"/>
  138.               </exsl:document>
  139.             </xsl:otherwise>
  140.           </xsl:choose>
  141.         </xsl:otherwise>
  142.       </xsl:choose>
  143.     </xsl:when>
  144.  
  145.     <xsl:when test="element-available('saxon:output')">
  146.       <xsl:choose>
  147.         <!-- Handle the permutations ... -->
  148.         <xsl:when test="$media-type != ''">
  149.           <xsl:choose>
  150.             <xsl:when test="$doctype-public != '' and $doctype-system != ''">
  151.               <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" standalone="{$standalone}">
  152.                 <xsl:copy-of select="$content"/>
  153.               </saxon:output>
  154.             </xsl:when>
  155.             <xsl:when test="$doctype-public != '' and $doctype-system = ''">
  156.               <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-public="{$doctype-public}" standalone="{$standalone}">
  157.                 <xsl:copy-of select="$content"/>
  158.               </saxon:output>
  159.             </xsl:when>
  160.             <xsl:when test="$doctype-public = '' and $doctype-system != ''">
  161.               <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-system="{$doctype-system}" standalone="{$standalone}">
  162.                 <xsl:copy-of select="$content"/>
  163.               </saxon:output>
  164.             </xsl:when>
  165.             <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
  166.               <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" standalone="{$standalone}">
  167.                 <xsl:copy-of select="$content"/>
  168.               </saxon:output>
  169.             </xsl:otherwise>
  170.           </xsl:choose>
  171.         </xsl:when>
  172.         <xsl:otherwise>
  173.           <xsl:choose>
  174.             <xsl:when test="$doctype-public != '' and $doctype-system != ''">
  175.               <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" standalone="{$standalone}">
  176.                 <xsl:copy-of select="$content"/>
  177.               </saxon:output>
  178.             </xsl:when>
  179.             <xsl:when test="$doctype-public != '' and $doctype-system = ''">
  180.               <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-public="{$doctype-public}" standalone="{$standalone}">
  181.                 <xsl:copy-of select="$content"/>
  182.               </saxon:output>
  183.             </xsl:when>
  184.             <xsl:when test="$doctype-public = '' and $doctype-system != ''">
  185.               <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-system="{$doctype-system}" standalone="{$standalone}">
  186.                 <xsl:copy-of select="$content"/>
  187.               </saxon:output>
  188.             </xsl:when>
  189.             <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
  190.               <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" standalone="{$standalone}">
  191.                 <xsl:copy-of select="$content"/>
  192.               </saxon:output>
  193.             </xsl:otherwise>
  194.           </xsl:choose>
  195.         </xsl:otherwise>
  196.       </xsl:choose>
  197.     </xsl:when>
  198.  
  199.     <xsl:when test="element-available('xalanredirect:write')">
  200.       <!-- Xalan uses xalanredirect -->
  201.       <xalanredirect:write file="{$filename}">
  202.         <xsl:copy-of select="$content"/>
  203.       </xalanredirect:write>
  204.     </xsl:when>
  205.  
  206.     <xsl:otherwise>
  207.       <!-- it doesn't matter since we won't be making chunks... -->
  208.       <xsl:message terminate="yes">
  209.         <xsl:text>Can't make chunks with </xsl:text>
  210.         <xsl:value-of select="system-property('xsl:vendor')"/>
  211.         <xsl:text>'s processor.</xsl:text>
  212.       </xsl:message>
  213.     </xsl:otherwise>
  214.   </xsl:choose>
  215. </xsl:template>
  216.  
  217. <xsl:template name="write.chunk.with.doctype">
  218.   <xsl:param name="filename" select="''"/>
  219.   <xsl:param name="quiet" select="0"/>
  220.  
  221.   <xsl:param name="method" select="$chunker.output.method"/>
  222.   <xsl:param name="encoding" select="$chunker.output.encoding"/>
  223.   <xsl:param name="indent" select="$chunker.output.indent"/>
  224.   <xsl:param name="omit-xml-declaration" select="$chunker.output.omit-xml-declaration"/>
  225.   <xsl:param name="standalone" select="$chunker.output.standalone"/>
  226.   <xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
  227.   <xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
  228.   <xsl:param name="media-type" select="$chunker.output.media-type"/>
  229.   <xsl:param name="cdata-section-elements" select="$chunker.output.cdata-section-elements"/>
  230.  
  231.   <xsl:param name="content"/>
  232.  
  233.   <xsl:call-template name="write.chunk">
  234.     <xsl:with-param name="filename" select="$filename"/>
  235.     <xsl:with-param name="quiet" select="$quiet"/>
  236.     <xsl:with-param name="method" select="$method"/>
  237.     <xsl:with-param name="encoding" select="$encoding"/>
  238.     <xsl:with-param name="indent" select="$indent"/>
  239.     <xsl:with-param name="omit-xml-declaration" select="$omit-xml-declaration"/>
  240.     <xsl:with-param name="standalone" select="$standalone"/>
  241.     <xsl:with-param name="doctype-public" select="$doctype-public"/>
  242.     <xsl:with-param name="doctype-system" select="$doctype-system"/>
  243.     <xsl:with-param name="media-type" select="$media-type"/>
  244.     <xsl:with-param name="cdata-section-elements" select="$cdata-section-elements"/>
  245.     <xsl:with-param name="content" select="$content"/>
  246.   </xsl:call-template>
  247. </xsl:template>
  248.  
  249. <xsl:template name="write.text.chunk">
  250.   <xsl:param name="filename" select="''"/>
  251.   <xsl:param name="quiet" select="0"/>
  252.   <xsl:param name="method" select="'text'"/>
  253.   <xsl:param name="encoding" select="$chunker.output.encoding"/>
  254.   <xsl:param name="media-type" select="$chunker.output.media-type"/>
  255.   <xsl:param name="content"/>
  256.  
  257.   <xsl:call-template name="write.chunk">
  258.     <xsl:with-param name="filename" select="$filename"/>
  259.     <xsl:with-param name="quiet" select="$quiet"/>
  260.     <xsl:with-param name="method" select="$method"/>
  261.     <xsl:with-param name="encoding" select="$encoding"/>
  262.     <xsl:with-param name="indent" select="'no'"/>
  263.     <xsl:with-param name="omit-xml-declaration" select="'no'"/>
  264.     <xsl:with-param name="standalone" select="'no'"/>
  265.     <xsl:with-param name="doctype-public"/>
  266.     <xsl:with-param name="doctype-system"/>
  267.     <xsl:with-param name="media-type" select="$media-type"/>
  268.     <xsl:with-param name="cdata-section-elements"/>
  269.     <xsl:with-param name="content" select="$content"/>
  270.   </xsl:call-template>
  271. </xsl:template>
  272.  
  273. </xsl:stylesheet>
  274.