home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 160 - Disc 2 / MF_UK_160_2.iso / pc / DiscContent / Trials / oxygen / lib / oxygen.jar / builtin / skeleton1-5.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2005-07-21  |  21.5 KB  |  557 lines

  1. <?xml version="1.0"?>
  2. <!-- Beta Skeleton Module for the Schematron 1.5 XML Schema Language.
  3.     http://www.ascc.net/xml/schematron/
  4.  
  5.  Copyright (c) 2000,2001 Rick Jelliffe and Academia Sinica Computing Center, Taiwan
  6.  
  7.  This software is provided 'as-is', without any express or implied warranty. 
  8.  In no event will the authors be held liable for any damages arising from 
  9.  the use of this software.
  10.  
  11.  Permission is granted to anyone to use this software for any purpose, 
  12.  including commercial applications, and to alter it and redistribute it freely,
  13.  subject to the following restrictions:
  14.  
  15.  1. The origin of this software must not be misrepresented; you must not claim
  16.  that you wrote the original software. If you use this software in a product, 
  17.  an acknowledgment in the product documentation would be appreciated but is 
  18.  not required.
  19.  
  20.  2. Altered source versions must be plainly marked as such, and must not be 
  21.  misrepresented as being the original software.
  22.  
  23.  3. This notice may not be removed or altered from any source distribution.
  24. -->
  25. <!-- 
  26.     Version: 2001-06-12
  27.            * same skeleton now supports namespace or no namespace
  28.            * parameters to handlers updated for all 1.5 attributes 
  29.            * diagnostic hints supported: command-line option diagnose=yes|no
  30.            * phases supported: command-line option phase=#ALL|...
  31.            * abstract rules
  32.            * compile-time error messages
  33.            * 1.6 feature: @match on sch:key  
  34.           
  35.     Contributors: Rick Jelliffe (original), Oliver Becker (architecture), 
  36.              Miloslav Nic (diagnostic, phase, options), Ludwig Svenonius (abstract)
  37.              Uche Ogbuji (misc. bug fixes), Jim Ancona (SAXON workaround),
  38.              Eddie Robertsson (misc. bug fixes)
  39.  
  40.     XSLT versions tested and working as-is: 
  41.            * MS XML 3
  42.            * Oracle 
  43.            * SAXON + Instant Saxon  
  44.            * XT n.b. key() not available, will die
  45.  
  46.    XSLT version reliably reported working
  47.            *  FourThought's Python implementation
  48.  
  49.     XSLT versions tested and requires small workaround from you
  50.            * Sablotron does not support import, so merge meta-stylesheets by hand
  51.            * Xalan for Java 2.0 outputs wrong namespace URI, so alter by hand or script
  52.            * Xalan for C 1.0 has problem with key, so edit by hand. Find "KEY" below  
  53.  
  54.    If you create your own meta-stylesheet to override this one, it is a
  55.    good idea to have both in the same directory and to run the stylesheet
  56.    from that directory, as many XSLT implementations have ideosyncratic
  57.    handling of URLs: keep it simple.
  58.          
  59. -->
  60. <xsl:stylesheet version="1.0" 
  61.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  62.     xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias" 
  63.     xmlns:sch="http://www.ascc.net/xml/schematron"
  64.      >
  65. <!-- Note that this namespace is not version specific.
  66. This program implements schematron 1.5 with some 1.6 extensions -->
  67. <xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="xsl"/>
  68. <!-- Category: top-level-element -->
  69. <xsl:output method="xml" omit-xml-declaration="no" standalone="yes"  indent="yes"/>
  70. <xsl:param name="block"></xsl:param><!-- reserved -->
  71. <xsl:param name="phase">
  72.   <xsl:choose>
  73.     <xsl:when test="//sch:schema/@defaultPhase">
  74.       <xsl:value-of select="//sch:schema/@defaultPhase"/>
  75.     </xsl:when>
  76.     <xsl:otherwise>#ALL</xsl:otherwise>
  77.   </xsl:choose>
  78. </xsl:param>
  79. <xsl:param name="hiddenKey"> key </xsl:param><!-- workaround for Xalan4J 2.0 -->
  80.  
  81. <!-- SCHEMA -->
  82. <xsl:template match="sch:schema | schema">
  83.     <axsl:stylesheet version="1.0">
  84.         <xsl:for-each select="sch:ns | ns">
  85.             <xsl:attribute name="{concat(@prefix,':dummy-for-xmlns')}" namespace="{@uri}"/>
  86.         </xsl:for-each>
  87.  
  88.         <xsl:if test="count(sch:title/* | title/* )">
  89.             <xsl:message>
  90.                 <xsl:text>Warning: </xsl:text>
  91.                 <xsl:value-of select="name(.)"/>
  92.                 <xsl:text> must not contain any child elements</xsl:text>
  93.             </xsl:message>
  94.         </xsl:if>
  95.  
  96.         <xsl:call-template name="process-prolog"/>
  97.         <!-- utility routine for implementations -->
  98.            <axsl:template match="*|@*" mode="schematron-get-full-path">
  99.  
  100.             <axsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
  101.             <axsl:text>/</axsl:text>
  102.             <axsl:if test="count(. | ../@*) = count(../@*)">@</axsl:if>
  103.             <axsl:value-of select="name()"/>
  104.             <axsl:text>[</axsl:text>
  105.               <axsl:value-of select="1+count(preceding-sibling::*[name()=name(current())])"/>
  106.               <axsl:text>]</axsl:text>
  107.                 </axsl:template>
  108.  
  109.         <xsl:apply-templates mode="do-keys" 
  110.                 select="sch:pattern/sch:rule/sch:key | pattern/rule/key | sch:key | key "/>
  111.  
  112.  
  113.         <axsl:template match="/">
  114.             <xsl:call-template name="process-root">
  115.                 <xsl:with-param name="fpi" select="@fpi"/>
  116.                 <xsl:with-param     xmlns:sch="http://www.ascc.net/xml/schematron"
  117.                 name="title" select="./sch:title | title"/>
  118.                 <xsl:with-param name="id" select="@id"/>
  119.                 <xsl:with-param name="icon" select="@icon"/>
  120.                 <xsl:with-param name="lang" select="@xml:lang"/>
  121.                 <xsl:with-param name="version" select="@version" />
  122.                 <xsl:with-param name="schemaVersion" select="@schemaVersion" />
  123.                 <xsl:with-param name="contents">
  124.                     <xsl:apply-templates mode="do-all-patterns"/>
  125.                 </xsl:with-param>
  126.             </xsl:call-template>
  127.         </axsl:template>
  128.  
  129.         <xsl:apply-templates/>
  130.         <axsl:template match="text()" priority="-1">
  131.             <!-- strip characters -->
  132.         </axsl:template>
  133.     </axsl:stylesheet>
  134. </xsl:template>
  135.  
  136.     <!-- ACTIVE -->
  137.     <xsl:template match="sch:active | active">
  138.                 <xsl:if test="not(@pattern)">
  139.                     <xsl:message>Markup Error: no pattern attribute in <active></xsl:message>
  140.                 </xsl:if>
  141.                 <xsl:if test="//sch:rule[@id= current()/@pattern]">
  142.                     <xsl:message>Reference Error: the pattern  "<xsl:value-of select="@pattern"/>" has been activated but is not declared</xsl:message>
  143.                 </xsl:if>
  144.         </xsl:template>
  145.  
  146.     <!-- ASSERT and REPORT -->
  147.     <xsl:template match="sch:assert | assert">
  148.                 <xsl:if test="not(@test)">
  149.                     <xsl:message>Markup Error: no test attribute in <assert></xsl:message>
  150.                 </xsl:if>
  151.         <axsl:choose>
  152.             <axsl:when test="{@test}"/>
  153.             <axsl:otherwise>
  154.                 <xsl:call-template name="process-assert">
  155.                     <xsl:with-param name="role" select="@role"/>
  156.                     <xsl:with-param name="id" select="@id"/>
  157.                     <xsl:with-param name="test" select="normalize-space(@test)" />
  158.                     <xsl:with-param name="icon" select="@icon"/>
  159.                     <xsl:with-param name="subject" select="@subject"/>
  160.                     <xsl:with-param name="diagnostics" select="@diagnostics"/>
  161.                 </xsl:call-template>  
  162.             </axsl:otherwise>
  163.         </axsl:choose>
  164.     </xsl:template>
  165.     <xsl:template match="sch:report | report">
  166.                 <xsl:if test="not(@test)">
  167.                     <xsl:message>Markup Error: no test attribute in <report></xsl:message>
  168.                 </xsl:if>
  169.         <axsl:if test="{@test}">
  170.             <xsl:call-template name="process-report">
  171.                 <xsl:with-param name="role" select="@role"/>
  172.                 <xsl:with-param name="test" select="normalize-space(@test)" />
  173.                 <xsl:with-param name="icon" select="@icon"/>
  174.                 <xsl:with-param name="id" select="@id"/>
  175.                 <xsl:with-param name="subject" select="@subject"/>
  176.                 <xsl:with-param name="diagnostics" select="@diagnostics"/>
  177.             </xsl:call-template>
  178.         </axsl:if>
  179.     </xsl:template>
  180.  
  181.  
  182.     <!-- DIAGNOSTIC -->
  183.     <xsl:template match="sch:diagnostic | diagnostic"
  184.               ><xsl:if test="not(@id)"
  185.                     ><xsl:message>Markup Error: no id attribute in <diagnostic></xsl:message
  186.                 ></xsl:if><xsl:call-template name="process-diagnostic">
  187.                 <xsl:with-param name="id" select="@id" />
  188.                </xsl:call-template>
  189.         </xsl:template>
  190.  
  191.     <!-- DIAGNOSTICS -->
  192.     <xsl:template match="sch:diagnostics | diagnostics"/>
  193.  
  194.     <!-- DIR -->
  195.     <xsl:template match="sch:dir | dir"  mode="text"
  196.         ><xsl:call-template name="process-dir">
  197.             <xsl:with-param name="value" select="@value"/>
  198.         </xsl:call-template>
  199.     </xsl:template>
  200.  
  201.     <!-- EMPH -->
  202.     <xsl:template match="sch:emph | emph"  mode="text"
  203.         ><xsl:call-template name="process-emph"/>
  204.     </xsl:template>
  205.  
  206.     <!-- EXTENDS -->
  207.     <xsl:template match="sch:extends | extends">
  208.         <xsl:if test="not(@rule)"
  209.                     ><xsl:message>Markup Error: no rule attribute in <extends></xsl:message
  210.                 ></xsl:if>
  211.              <xsl:if test="not(//sch:rule[@abstract='true'][@id= current()/@rule] )
  212.                     and not(//rule[@abstract='true'][@id= current()/@rule])">
  213.                     <xsl:message>Reference Error: the abstract rule  "<xsl:value-of select="@rule"/>" has been referenced but is not declared</xsl:message>
  214.                 </xsl:if>
  215.             <xsl:call-template name="IamEmpty" />
  216.  
  217.           <xsl:if test="//sch:rule[@id=current()/@rule]">
  218.                 <xsl:apply-templates select="//sch:rule[@id=current()/@rule]"
  219.                 mode="extends"/>
  220.           </xsl:if>
  221.  
  222.     </xsl:template>
  223.  
  224.     <!-- KEY -->
  225.     <!-- do we need something to test uniqueness too? --> 
  226.     <!-- NOTE: if you get complaint about "key" here (e.g. Xalan4C 1.0) replace
  227.         "key" with "$hiddenKey" -->
  228.     <xsl:template  match="sch:key | key " mode="do-keys" >
  229.                 <xsl:if test="not(@name)">
  230.                     <xsl:message>Markup Error: no name attribute in <key></xsl:message>
  231.                 </xsl:if>
  232.                <xsl:if test="not(@match) and not(../sch:rule)">
  233.                     <xsl:message>Markup Error:  no match attribute on <key> outside <rule></xsl:message>
  234.                 </xsl:if>
  235.                 <xsl:if test="not(@path)">
  236.                     <xsl:message>Markup Error: no path attribute in <key></xsl:message>
  237.                 </xsl:if>
  238.             <xsl:call-template name="IamEmpty" />
  239.  
  240.              <xsl:choose>
  241.             <xsl:when test="@match">
  242.                 <axsl:key match="{@match}" name="{@name}" use="{@path}"/>
  243.             </xsl:when>
  244.             <xsl:otherwise>
  245.                 <axsl:key name="{@name}" match="{parent::sch:rule/@context}" use="{@path}"/>
  246.             </xsl:otherwise>
  247.         </xsl:choose>
  248.     </xsl:template>
  249.  
  250.       <xsl:template match="sch:key | key"  /><!-- swallow --> 
  251.  
  252.     <!-- NAME -->
  253.     <xsl:template match="sch:name | name" mode="text">
  254.         <axsl:text xml:space="preserve"> </axsl:text>
  255.             <xsl:if test="@path"
  256.                 ><xsl:call-template name="process-name">
  257.                     <xsl:with-param name="name" select="concat('name(',@path,')')"/>
  258.                     <!-- SAXON needs that instead of  select="'name({@path})'"  -->
  259.                 </xsl:call-template>
  260.             </xsl:if>
  261.             <xsl:if test="not(@path)"
  262.                 ><xsl:call-template name="process-name">
  263.                     <xsl:with-param name="name" select="'name(.)'"/>
  264.                 </xsl:call-template>
  265.             </xsl:if>
  266.                 <xsl:call-template name="IamEmpty" />
  267.         <axsl:text xml:space="preserve"> </axsl:text>
  268.     </xsl:template>
  269.  
  270.     <!-- NS -->
  271.     <xsl:template match="sch:ns | ns"  mode="do-all-patterns" >
  272.                <xsl:if test="not(@uri)">
  273.                     <xsl:message>Markup Error: no uri attribute in <ns></xsl:message>
  274.                 </xsl:if>
  275.                <xsl:if test="not(@prefix)">
  276.                     <xsl:message>Markup Error: no prefix attribute in <ns></xsl:message>
  277.                 </xsl:if>
  278.             <xsl:call-template name="IamEmpty" />
  279.         <xsl:call-template name="process-ns" >
  280.             <xsl:with-param name="prefix" select="@prefix"/>
  281.             <xsl:with-param name="uri" select="@uri"/>
  282.         </xsl:call-template>
  283.     </xsl:template>
  284.     <xsl:template match="sch:ns | ns"  /><!-- swallow -->
  285.  
  286.     <!-- P -->
  287.     <xsl:template match="sch:schema/sch:p | schema/p" mode="do-schema-p" >
  288.         <xsl:call-template name="process-p">
  289.             <xsl:with-param name="class" select="@class"/>
  290.             <xsl:with-param name="icon" select="@icon"/>
  291.             <xsl:with-param name="id" select="@id"/>
  292.             <xsl:with-param name="lang" select="@xml:lang"/>
  293.         </xsl:call-template>
  294.     </xsl:template>
  295.     <xsl:template match="sch:pattern/sch:p | pattern/p" mode="do-pattern-p" >
  296.         <xsl:call-template name="process-p">
  297.             <xsl:with-param name="class" select="@class"/>
  298.             <xsl:with-param name="icon" select="@icon"/>
  299.             <xsl:with-param name="id" select="@id"/>
  300.             <xsl:with-param name="lang" select="@xml:lang"/>
  301.         </xsl:call-template>
  302.     </xsl:template>
  303.     <xsl:template match="sch:phase/sch:p" /><!-- We don't use these -->
  304.     <xsl:template match="sch:p | p" />
  305.  
  306.     <!-- PATTERN -->
  307.     <xsl:template match="sch:pattern | pattern" mode="do-all-patterns">
  308.     <xsl:if test="($phase = '#ALL') 
  309.     or (../sch:phase[@id= ($phase)]/sch:active[@pattern= current()/@id])
  310.     or (../phase[@id= ($phase)]/active[@id= current()/@id])">
  311.         <xsl:call-template name="process-pattern">
  312.             <xsl:with-param name="name" select="@name"/>
  313.             <xsl:with-param name="id" select="@id"/>
  314.             <xsl:with-param name="see" select="@see"/>
  315.             <xsl:with-param name="fpi" select="@fpi"/>
  316.             <xsl:with-param name="icon" select="@icon"/>
  317.         </xsl:call-template>
  318.         <axsl:apply-templates select="/" mode="M{count(preceding-sibling::*)}"/>
  319.         </xsl:if>
  320.     </xsl:template>
  321.     
  322.     <xsl:template match="sch:pattern | pattern">
  323.         <xsl:if test="($phase = '#ALL') 
  324.     or (../sch:phase[@id= ($phase)]/sch:active[@pattern= current()/@id])
  325.     or (../phase[@id= ($phase)]/active[@id= current()/@id])">
  326.         <xsl:apply-templates/>
  327.         <axsl:template match="text()" priority="-1" mode="M{count(preceding-sibling::*)}">
  328.             <!-- strip characters -->
  329.         </axsl:template>
  330.         </xsl:if>
  331.     </xsl:template>
  332.  
  333.     <!-- PHASE -->
  334.     <xsl:template match="sch:phase | phase" >
  335.                 <xsl:if test="not(@id)">
  336.                     <xsl:message>Markup Error: no id attribute in <phase></xsl:message>
  337.                 </xsl:if>
  338.     </xsl:template>
  339.  
  340.     <!-- RULE -->
  341.     <xsl:template match="sch:rule[not(@abstract='true')] | rule[not(@abstract='true')]">
  342.                 <xsl:if test="not(@context)">
  343.                     <xsl:message>Markup Error: no context attribute in <rule></xsl:message>
  344.                 </xsl:if>
  345.         <axsl:template match="{@context}" priority="{4000 - count(preceding-sibling::*)}" mode="M{count(../preceding-sibling::*)}">
  346.             <xsl:call-template name="process-rule">
  347.                 <xsl:with-param name="id" select="@id"/>
  348.                 <xsl:with-param name="context" select="@context"/>
  349.                 <xsl:with-param name="role" select="@role"/>
  350.             </xsl:call-template>
  351.             <xsl:apply-templates/>
  352.             <axsl:apply-templates mode="M{count(../preceding-sibling::*)}"/>
  353.         </axsl:template>
  354.     </xsl:template>
  355.  
  356.  
  357.     <!-- ABSTRACT RULE -->
  358.     <xsl:template match="sch:rule[@abstract='true'] | rule[@abstract='true']" >
  359.         <xsl:if test=" not(@id)">
  360.                     <xsl:message>Markup Error: no id attribute on abstract <rule></xsl:message>
  361.                 </xsl:if>
  362.          <xsl:if test="@context">
  363.                     <xsl:message>Markup Error: (2) context attribute on abstract <rule></xsl:message>
  364.                 </xsl:if>
  365.     </xsl:template>
  366.  
  367.     <xsl:template match="sch:rule[@abstract='true'] | rule[@abstract='true']"
  368.         mode="extends" >
  369.                 <xsl:if test="@context">
  370.                     <xsl:message>Markup Error: context attribute on abstract <rule></xsl:message>
  371.                 </xsl:if>
  372.             <xsl:apply-templates/>
  373.     </xsl:template>
  374.  
  375.     <!-- SPAN -->
  376.     <xsl:template match="sch:span | span" mode="text">
  377.         <xsl:call-template name="process-span"
  378.             ><xsl:with-param name="class" select="@class"/>
  379.         </xsl:call-template>
  380.     </xsl:template>
  381.  
  382.     <!-- TITLE -->
  383.     <!-- swallow -->
  384.     <xsl:template match="sch:title | title" /> 
  385.  
  386.     <!-- VALUE-OF -->
  387.     <xsl:template match="sch:value-of | value-of" mode="text" >
  388.                <xsl:if test="not(@select)">
  389.                     <xsl:message>Markup Error: no select attribute in <value-of></xsl:message>
  390.                 </xsl:if>
  391.             <xsl:call-template name="IamEmpty" />
  392.         <axsl:text xml:space="preserve"> </axsl:text>
  393.         <xsl:choose>
  394.             <xsl:when test="@select"
  395.                 ><xsl:call-template name="process-value-of">
  396.                     <xsl:with-param name="select" select="@select"/>  
  397.                                    <!-- will saxon have problem with this too?? -->
  398.                 </xsl:call-template>
  399.             </xsl:when>
  400.             <xsl:otherwise >
  401.                 <xsl:call-template name="process-value-of"
  402.                     ><xsl:with-param name="select" select="'.'"/>
  403.                 </xsl:call-template>
  404.             </xsl:otherwise>
  405.                 </xsl:choose>
  406.         <axsl:text xml:space="preserve"> </axsl:text>
  407.     </xsl:template>
  408.  
  409. <!-- ============================================================== -->
  410.     <!-- Text -->
  411.     <xsl:template match="text()" priority="-1" mode="do-keys">
  412.         <!-- strip characters -->
  413.     </xsl:template>
  414.     <xsl:template match="text()" priority="-1" mode="do-all-patterns">
  415.         <!-- strip characters -->
  416.     </xsl:template>
  417.         <xsl:template match="text()" priority="-1" mode="do-schema-p">
  418.         <!-- strip characters -->
  419.     </xsl:template>
  420.         <xsl:template match="text()" priority="-1" mode="do-pattern-p">
  421.         <!-- strip characters -->
  422.     </xsl:template>
  423.     <xsl:template match="text()" priority="-1">
  424.         <!-- strip characters -->
  425.     </xsl:template>
  426.     <xsl:template match="text()" mode="text">
  427.         <xsl:value-of select="normalize-space(.)"/>
  428.     </xsl:template>
  429.  
  430.     <xsl:template match="text()" mode="inline-text">
  431.         <xsl:value-of select="."/>
  432.     </xsl:template>
  433.  
  434. <!-- ============================================================== -->
  435. <!-- utility templates -->
  436. <xsl:template name="IamEmpty">
  437.     <xsl:if test="count( * )">
  438.         <xsl:message>
  439.             <xsl:text>Warning: </xsl:text>
  440.             <xsl:value-of select="name(.)"/>
  441.             <xsl:text> must not contain any child elements</xsl:text>
  442.         </xsl:message>
  443.     </xsl:if>
  444. </xsl:template>
  445.  
  446. <xsl:template name="diagnosticsSplit">
  447.   <!-- Process at the current point the first of the <diagnostic> elements
  448.        referred to parameter str, and then recurse -->
  449.   <xsl:param name="str"/>
  450.   <xsl:variable name="start">
  451.     <xsl:choose>
  452.       <xsl:when test="contains($str,' ')">
  453.     <xsl:value-of  select="substring-before($str,' ')"/>
  454.       </xsl:when>
  455.       <xsl:otherwise><xsl:value-of select="$str"/></xsl:otherwise>
  456.     </xsl:choose>
  457.   </xsl:variable>
  458.  
  459.   <xsl:variable name="end">
  460.     <xsl:if test="contains($str,' ')">
  461.       <xsl:value-of select="substring-after($str,' ')"/>
  462.     </xsl:if>
  463.   </xsl:variable>
  464.  
  465.   <xsl:if test="not(string-length(normalize-space($start)) = 0)
  466.     and not(//sch:diagnostic[@id = ($start)]) and not(//diagnostic[@id = ($start)])">
  467.     <xsl:message>Reference error: A diagnostic "<xsl:value-of select="string($start)"/>" has been referenced but is not declared</xsl:message>
  468.   </xsl:if>
  469.  
  470.   <xsl:if test="string-length(normalize-space($start)) > 0">
  471.      <xsl:apply-templates 
  472.         select="//sch:diagnostic[@id = ($start) ] | //diagnostic[@id= ($start) ]"/>
  473.   </xsl:if>
  474.  
  475.   <xsl:if test="not($end='')">
  476.     <xsl:call-template name="diagnosticsSplit">
  477.       <xsl:with-param name="str" select="$end"/>
  478.     </xsl:call-template>
  479.   </xsl:if>
  480. </xsl:template>
  481.  
  482.  
  483. <!-- ============================================================== -->
  484.  
  485.     <xsl:template match="*">
  486.         <xsl:message>
  487.             <xsl:text>Warning: unrecognized element </xsl:text>
  488.             <xsl:value-of select="name(.)"/>
  489.         </xsl:message>
  490.     </xsl:template>
  491.     <xsl:template match="*" mode="text">
  492.         <xsl:message>
  493.             <xsl:text>Warning: unrecognized element </xsl:text>
  494.             <xsl:value-of select="name(.)"/>
  495.         </xsl:message>
  496.     </xsl:template>
  497. <!-- ============================================================== -->
  498.     <!-- Default named templates -->
  499.     <!-- These are the actions that are performed unless overridden -->
  500.     <xsl:template name="process-prolog"/>
  501.     <!-- no params -->
  502.     <xsl:template name="process-root">
  503.         <xsl:param name="contents"/>
  504.         <!-- unused params: fpi, title, id, icon, lang, version, schemaVersion -->
  505.         <xsl:copy-of select="$contents"/>
  506.     </xsl:template>
  507.     <xsl:template name="process-assert">
  508.         <xsl:param name="role"/>
  509.         <xsl:param name="test"/>
  510.         <!-- unused parameters: id, icon, diagnostics, subject -->
  511.         <xsl:call-template name="process-message">
  512.             <xsl:with-param name="pattern" select="$test"/>
  513.             <xsl:with-param name="role" select="$role"/>
  514.         </xsl:call-template>
  515.     </xsl:template>
  516.     <xsl:template name="process-report">
  517.         <xsl:param name="role"/>
  518.         <xsl:param name="test"/>
  519.         <!-- unused parameters: id, icon, diagnostics, subject -->
  520.         <xsl:call-template name="process-message">
  521.             <xsl:with-param name="pattern" select="$test"/>
  522.             <xsl:with-param name="role" select="$role"/>
  523.         </xsl:call-template>
  524.     </xsl:template>
  525.     <xsl:template name="process-diagnostic">
  526.         <!-- params: id -->
  527.         <xsl:apply-templates mode="text"/>
  528.     </xsl:template>
  529.     <xsl:template name="process-dir" 
  530.         ><xsl:apply-templates mode="inline-text"/></xsl:template>
  531.     <xsl:template name="process-emph" 
  532.         ><xsl:apply-templates mode="inline-text"/></xsl:template>
  533.     <xsl:template name="process-name">
  534.         <xsl:param name="name"
  535.         /><axsl:value-of select="{$name}"/></xsl:template>
  536.     <xsl:template name="process-ns" />
  537.     <!-- unused params: prefix, uri -->
  538.     <!-- note that this is independent of the use of sch:ns by sch:schema -->
  539.     <xsl:template name="process-p"/>
  540.     <!-- unused params: class, id, icon, lang -->
  541.     <xsl:template name="process-pattern"/>
  542.     <!-- unused params: name, id, see, fpi, icon -->
  543.     <xsl:template name="process-rule"/>
  544.     <!-- unused params: id, context, role -->
  545.     <xsl:template name="process-span" 
  546.         ><xsl:apply-templates mode="inline-test"/></xsl:template>
  547.     <xsl:template name="process-value-of">
  548.         <xsl:param name="select"
  549.         /><axsl:value-of select="{$select}"/></xsl:template>
  550.     <!-- default output action: the simplest customization is to just override this -->
  551.     <xsl:template name="process-message">
  552.         <!-- params: pattern, role -->
  553.         <xsl:apply-templates mode="text"/>
  554.     </xsl:template>
  555. </xsl:stylesheet>
  556.  
  557.