home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esdXDR.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2000-07-03  |  29.4 KB  |  796 lines  |  [TEXT/ttxt]

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" version="1.0" xmlns="http://www.w3.org/TR/REC-html40" xmlns:s="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:local="#local-functions">
  3.  
  4.       <xsl:param name="imageDir" select="'sdimages'"/>
  5.       <xsl:param name="schemaName" select="' '"/>
  6.     <xsl:output method="html" indent="no"/>
  7.     <xsl:strip-space elements="*"/>
  8.     <xsl:template match="/">
  9.         <html>
  10.             <head>
  11.                 <title>SchemaDOC - <xsl:value-of select="$schemaName"/> </title>
  12.                 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  13.                 <link rel="stylesheet" href="ext.css"/>
  14.                 <style type="text/css">
  15.                     <!-- container for expanding/collapsing content -->
  16.                     .c  {cursor:hand}
  17.  
  18.                     <!-- button - contains +/-/nbsp -->
  19.                     .b  {color:red; font-family:'Courier New'; font-weight:bold; text-decoration:none}
  20.                     
  21.                     <!-- element container -->
  22.                     .e  {margin-left:1em; text-indent:-1em; margin-right:1em}
  23.  
  24.                     <!-- comment or cdata -->
  25.                     .k  {margin-left:1em; text-indent:-1em; margin-right:1em}
  26.  
  27.                     <!-- tag -->
  28.                     .t  {color:#000066}
  29.  
  30.                     <!-- elementtype +eleemnt-->
  31.                     .et  {color:#0000FF}
  32.  
  33.                     <!-- xdr default element attributes-->
  34.                     .xdra  {color:#006600}
  35.  
  36.                     <!-- tag in xsl namespace -->
  37.                     .xt {color:#990099}
  38.  
  39.                     <!-- attribute in xml or xmlns namespace -->
  40.                     .ns {color:red}
  41.  
  42.                     <!-- markup characters -->
  43.                     .m  {color:blue}
  44.  
  45.                     <!-- text node -->
  46.                     .tx {font-weight:bold}
  47.  
  48.                     <!-- multi-line (block) cdata -->
  49.                     .db {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;   padding-left:.3em; border-left:1px solid #CCCCCC; font:small Courier}
  50.  
  51.                     <!-- single-line (inline) cdata -->
  52.                     .di {font:small Courier}
  53.  
  54.                     <!-- DOCTYPE declaration -->
  55.                     .d  {color:blue}
  56.  
  57.                     <!-- pi -->
  58.                     .pi {color:blue}
  59.  
  60.                     <!-- multi-line (block) comment -->
  61.                     .cb {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;              padding-left:.3em; font:small Courier; color:#888888}
  62.  
  63.                     <!-- single-line (inline) comment -->
  64.                     .ci {font:small Courier; color:#888888}         PRE {margin:0px; display:inline}   h1 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18pt; color: #000000}          .heading { text-align:right;}         .content { vertical-align: baseline; }         .note { color:gray;}
  65.  
  66. .names   {font-family:' Arial, Helvetica'; font-weight:bold; font-size:12 }
  67. .source  {font-family:'Courier New'; font-size:12 }
  68. .values  {font-family:'Verdana, Arial, Helvetica'; font-size:12 }
  69. .headers {font-family:'Verdana, Arial, Helvetica'; font-weight:bold; font-size:12 }
  70. .descriptions {font-family:'Courier New'; color:redfont-size:12 }
  71.  
  72.  
  73.                 </style>
  74.                 <SCRIPT type="text/javascript">
  75.                     <xsl:comment>
  76. <![CDATA[
  77.         // Detect and switch the display of CDATA and comments from an inline view
  78.         //  to a block view if the comment or CDATA is multi-line.
  79.         function f(e)
  80.         {
  81.           // if this element is an inline comment, and contains more than a single
  82.           //  line, turn it into a block comment.
  83.           if (e.className == "ci") {
  84.             if (e.children(0).innerText.indexOf("\n") > 0)
  85.               fix(e, "cb");
  86.           }
  87.           
  88.           // if this element is an inline cdata, and contains more than a single
  89.           //  line, turn it into a block cdata.
  90.           if (e.className == "di") {
  91.             if (e.children(0).innerText.indexOf("\n") > 0)
  92.               fix(e, "db");
  93.           }
  94.           
  95.           // remove the id since we only used it for cleanup
  96.           e.id = "";
  97.         }
  98.         
  99.         // Fix up the element as a "block" display and enable expand/collapse on it
  100.         function fix(e, cl)
  101.         {
  102.           // change the class name and display value
  103.           e.className = cl;
  104.           e.style.display = "block";
  105.           
  106.           // mark the comment or cdata display as a expandable container
  107.           j = e.parentElement.children(0);
  108.           j.className = "c";
  109.  
  110.           // find the +/- symbol and make it visible - the dummy link enables tabbing
  111.           k = j.children(0);
  112.           k.style.visibility = "visible";
  113.           k.href = "#";
  114.         }
  115.  
  116.         // Change the +/- symbol and hide the children.  This function works on "element"
  117.         //  displays
  118.         function ch(e)
  119.         {
  120.           // find the +/- symbol
  121.           mark = e.children(0).children(0);
  122.           
  123.           // if it is already collapsed, expand it by showing the children
  124.           if (mark.innerText == "+")
  125.           {
  126.             mark.innerText = "-";
  127.             for (var i = 1; i < e.children.length; i++)
  128.               e.children(i).style.display = "block";
  129.           }
  130.           
  131.           // if it is expanded, collapse it by hiding the children
  132.           else if (mark.innerText == "-")
  133.           {
  134.             mark.innerText = "+";
  135.             for (var i = 1; i < e.children.length; i++)
  136.               e.children(i).style.display="none";
  137.           }
  138.         }
  139.         
  140.         // Change the +/- symbol and hide the children.  This function work on "comment"
  141.         //  and "cdata" displays
  142.         function ch2(e)
  143.         {
  144.           // find the +/- symbol, and the "PRE" element that contains the content
  145.           mark = e.children(0).children(0);
  146.           contents = e.children(1);
  147.           
  148.           // if it is already collapsed, expand it by showing the children
  149.           if (mark.innerText == "+")
  150.           {
  151.             mark.innerText = "-";
  152.             // restore the correct "block"/"inline" display type to the PRE
  153.             if (contents.className == "db" || contents.className == "cb")
  154.               contents.style.display = "block";
  155.             else contents.style.display = "inline";
  156.           }
  157.           
  158.           // if it is expanded, collapse it by hiding the children
  159.           else if (mark.innerText == "-")
  160.           {
  161.             mark.innerText = "+";
  162.             contents.style.display = "none";
  163.           }
  164.         }
  165.         
  166.         // Handle a mouse click
  167.         function cl()
  168.         {
  169.           e = window.event.srcElement;
  170.           
  171.           // make sure we are handling clicks upon expandable container elements
  172.           if (e.className != "c")
  173.           {
  174.             e = e.parentElement;
  175.             if (e.className != "c")
  176.             {
  177.               return;
  178.             }
  179.           }
  180.           e = e.parentElement;
  181.           
  182.           // call the correct funtion to change the collapse/expand state and display
  183.           if (e.className == "e")
  184.             ch(e);
  185.           if (e.className == "k")
  186.             ch2(e);
  187.         }
  188.         
  189.         // Erase bogus link info from the status window
  190.         function h()
  191.         {
  192.           window.status=" ";
  193.         }
  194.  
  195.         // Set the onclick handler
  196.         document.onclick = cl;
  197.         
  198.       ]]>
  199.                         //
  200.                     </xsl:comment>
  201.                 </SCRIPT>
  202. <link rel="stylesheet" href="Library/esd.css"/>            
  203. </head>
  204.             <body bgcolor="#FFFFFF" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">
  205.                 <xsl:apply-templates/>
  206.                 <center>
  207.                 <table border="0" WIDTH="90%" BGCOLOR="#eeeeee" >
  208.                 <tr>
  209.                      <td> 
  210.                 <xsl:apply-templates mode="copy"/>
  211.                     </td>
  212.                    </tr>
  213.                  </table>
  214.                 </center>
  215.                 
  216.             </body>
  217.         </html>
  218.     </xsl:template>
  219. <xsl:template match="s:Schema">
  220.         <table width="90%" border="0" cellspacing="4" cellpadding="2" align="center">
  221.             <tr  >
  222.                     <td bgcolor="#003366"  colspan="2" >
  223.                         <font face="Arial,Helvetica" size="5" color="#FFFFFF">
  224.                      
  225.                         XML Schema
  226.                         <xsl:if test="@name">
  227.                             :
  228.                             <xsl:value-of select="@name"/>
  229.                             -
  230.                         </xsl:if>
  231.                         
  232.                         <xsl:value-of select="$schemaName"/>
  233.                     
  234.                     </font>
  235.                 </td>
  236.             </tr>
  237.             <xsl:if test="s:description">
  238.             <tr >
  239.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  240.                     Schema Comments:
  241.                 </td>
  242.                 <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
  243.                     <font color="#990000">
  244.                     <xsl:apply-templates mode="schemacomments" select="./s:description"/></font>
  245.                 </td>
  246.             </tr>
  247.              </xsl:if>
  248.             <tr>
  249.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  250.                     <div class="headers">Schema has:</div>
  251.                 </td>
  252.                 <td class="values" bgcolor="eeeeee" align="left" valign="top">
  253.                     <xsl:number value="count(s:ElementType)"/>
  254.                                     element definitions, 
  255.                                     <xsl:number value="count(s:AttributeType)"/>
  256.                                     global attribute definitions.
  257.                                     <xsl:number value="count(s:ElementType/s:AttributeType)"/>
  258.                                     element attribute definitions.
  259.                 </td>
  260.             </tr>
  261.  
  262.             <tr>
  263.                 <td width="20%" class="headers"  bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
  264.                     Posible root elements:
  265.                 </td>
  266.                 <td class="values" bgcolor="eeeeee" align="left" valign="top">
  267.                                 <xsl:for-each select="s:ElementType">
  268.                                     <xsl:sort select="@name"/>
  269.                                     <xsl:choose>
  270.                                         <!-- Look for root elements  -->
  271.                                         <xsl:when test="/*[not(.//s:element[@type=current()/@name])]">
  272.                                             <B>
  273.                                                 <
  274.                                                 <A>
  275.                                                     <xsl:attribute name="href">#ELEMENT_<xsl:value-of select="@name"/>
  276.                                                     </xsl:attribute>
  277.                                                     <xsl:value-of select="@name"/>
  278.                                                 </A>
  279.                                                 >
  280.                                             </B>
  281.                                             <xsl:choose>
  282.                                                 <xsl:when test=".//s:element">†</xsl:when>
  283.                                                 <xsl:otherwise>(orphan?)   </xsl:otherwise>
  284.                                             </xsl:choose>
  285.                                     <xsl:if test="(position()+1) mod 3 = 1">
  286.                                     <br/>
  287.                                     </xsl:if>
  288.  
  289.                                         </xsl:when>
  290.                                     </xsl:choose>
  291.                                 </xsl:for-each>
  292.                 </td>
  293.             </tr>
  294.         </table>
  295.         <p/>
  296.         <p/>        <p/>
  297.         <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
  298.         <tr  >
  299.                     <td bgcolor="#003366"  >
  300.                         <font face="Arial,Helvetica" size="5" color="#FFFFFF">
  301.                             Element list
  302.                         </font>
  303.                 </td>
  304.             </tr>            
  305.         </table>
  306.         <p/>
  307.         <xsl:apply-templates mode="anElement" select="s:ElementType"/>
  308.  
  309.  
  310.         <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
  311.             <tr>
  312.             <td bgcolor="#8888ff"  >
  313.                 <font face="Arial,Helvetica" size="5" color="#FFFFFF">
  314.                             Global Attributes
  315.                 </font>
  316.             </td>
  317.             </tr>            
  318.         </table>
  319.             <table width="90%" cellspacing="0" cellpadding="0" border="0"  bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  320.                 <tr>
  321.                     <td width="3%" bgcolor="#8888ff" align="left" valign="top">†</td>
  322.                     <td width="97%" align="left" valign="top">
  323.                         <table width="100%" cellspacing="3" cellpadding="1" border="0"  align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
  324.                             <tr>
  325.                                 <th width="15%" bgcolor="#CCCCCC" align="right" valign="top">
  326.                                     <span class="headers">Attribute</span>
  327.                                 </th>
  328.                                 <th width="25%" bgcolor="#eeeeee" align="left">
  329.                                     <span class="headers">Datatype</span>
  330.                                 </th>
  331.                                 <th width="35%" bgcolor="#eeeeee" align="left">
  332.                                     <span class="headers">Required</span>
  333.                                 </th>
  334.                                 <th width="25%" bgcolor="#eeeeee" align="left">
  335.                                     <span class="headers">Values</span>
  336.                                 </th>
  337.                                 <th width="25%" bgcolor="#eeeeee" align="left">
  338.                                     <span class="headers">Default</span>
  339.                                 </th>
  340.                             </tr>
  341.                             <xsl:apply-templates mode="detailAttrib" select="s:AttributeType"/>
  342.                         </table>
  343.                     </td>
  344.                 </tr>
  345.             </table>
  346.         <P/>
  347.         <P/>
  348.         <P/>
  349.         <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
  350.             <tr>
  351.             <td bgcolor="#bbbbbb"  >
  352.                 <font face="Arial,Helvetica" size="5" color="#FFFFFF">
  353.                                     <xsl:if test="@name">
  354.                 <xsl:value-of select="@name"/>
  355.             </xsl:if>
  356.             Original Schema Source
  357.  
  358.                 </font>
  359.             </td>
  360.             </tr>            
  361.         </table>        
  362.     </xsl:template>
  363. <!--END s:schema***********************************************************-->
  364. <!--END s:schema***********************************************************-->
  365.     <xsl:template mode="anElement" match="s:ElementType">
  366.         <center>
  367.             <table width="90%" cellspacing="0" cellpadding="2" border="0" >
  368.                 <tr bgcolor="#003366">
  369.                     <td>
  370.                         <font face="Arial,Helvetica" color="#FFFFFF">
  371.                             Element
  372.                             <A>
  373.                                 <xsl:attribute name="name">ELEMENT_<xsl:value-of select="@name"/>
  374.                                 </xsl:attribute>
  375.                                 <b>
  376.                                     <xsl:value-of select="@name"/>
  377.                                 </b>
  378.                             </A>
  379.                         </font>
  380.                     </td>
  381.                 </tr>
  382.             </table>
  383.         </center>
  384.         <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  385.             <tr>
  386.                 <td width="3%" bgcolor="#4444FF" align="left" valign="middle">†</td>
  387.                 <td width="97%" align="left" valign="top">
  388.                     <table width="100%" cellspacing="3" cellpadding="1" border="0" bordercolor="#FFFFFF" align="left">
  389.                         <tr>
  390.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  391.                                     diagram
  392.                                 </td>
  393.                             <td align="left" valign="top" bgcolor="#eeeeeeee" >
  394.                                 <img>
  395.                                     <xsl:attribute name="SRC"><xsl:value-of select="$imageDir"/>/<xsl:value-of select="@name"/>.gif
  396.                                     </xsl:attribute>
  397.                                 </img>
  398.                             </td>
  399.                         </tr>
  400.                         <xsl:if test="s:description">
  401.                             <tr>
  402.                                 <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  403.                                     description
  404.                                 </td>
  405.                                 <td width="85%" class="descriptions"  align="left" bgcolor="#eeeeeeee" wrap="true">
  406.                                     <font color="#990000">
  407.                                     <xsl:apply-templates mode="schemacomments" select="./s:description"/></font>
  408.                                 </td>
  409.                             </tr>
  410.                         </xsl:if>
  411.                         <tr>
  412.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  413.                                 attributes
  414.                             </td>
  415.                             <td width="85%" class="values" bgcolor="#eeeeeeee">
  416.                                 <xsl:apply-templates mode="glanceAttrib" select="s:attribute"/>
  417.                             </td>
  418.                         </tr>
  419.                          <tr>
  420.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  421.                                 uses
  422.                             </td>
  423.                             <td width="85%" class="values" bgcolor="#eeeeeeee"> <xsl:apply-templates mode="anElement" select="s:element"/>
  424.                             </td>
  425.                         </tr>
  426.                     </table>
  427.                 </td>
  428.             </tr>
  429.         </table>
  430.         <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  431.             <tr>
  432.                 <td width="3%" bgcolor="#6666FF" align="center" valign="top">†</td>
  433.                 <td width="97%" align="center" valign="left">
  434.                     <table width="100%" cellspacing="3" cellpadding="1" border="0" align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
  435.                         <!-- Find the parents -->
  436.                         <TR>
  437.                             <TD width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">used by</TD>
  438.                             <TD class="values" bgcolor="#eeeeee" align="left" valign="top">
  439.                                 <xsl:choose>
  440.                                     <xsl:when test="../s:ElementType[.//s:element[@type = current()/@name ]]">
  441.                                         <xsl:for-each select="../s:ElementType[.//s:element[@type = current()/@name ]]">
  442.                                             <xsl:sort select="@name"/>
  443.                                             <A class="element-link">
  444.                                                 <xsl:attribute name="HREF">
  445.                                                     #ELEMENT_
  446.                                                     <xsl:value-of select="@name"/>
  447.                                                 </xsl:attribute>
  448.                                                 <xsl:value-of select="@name"/>
  449.                                             </A>
  450.                                             †
  451.                                             <xsl:if test="current()[position()!=last()]">,</xsl:if>
  452.                                         </xsl:for-each>
  453.                                     </xsl:when>
  454.                                     <xsl:otherwise>
  455.                                         <xsl:choose>
  456.                                             <xsl:when test=".//s:element">
  457.                                                 <SPAN class="note">Not used by other elements. Possible root element.</SPAN>
  458.                                             </xsl:when>
  459.                                             <xsl:otherwise>
  460.                                                 <SPAN class="note">Not used by other elements. Probably an orphan.</SPAN>
  461.                                             </xsl:otherwise>
  462.                                         </xsl:choose>
  463.                                     </xsl:otherwise>
  464.                                 </xsl:choose>
  465.                             </TD>
  466.                         </TR>
  467.                         <tr>
  468.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  469.                             content
  470.                             </td>
  471.                             <td width="85%" class="values" bgcolor="#eeeeeeee">
  472.       <xsl:choose>
  473.         <xsl:when test="@dt:type">
  474.           <A ><xsl:attribute name="href">http://apps.xmlschema.com/schemaDoc/xdrref.htm#datatype_<xsl:value-of select="@dt:type"></xsl:value-of></xsl:attribute>
  475.             <xsl:value-of select="@dt:type"></xsl:value-of></A> datatype
  476.         </xsl:when>
  477.         <xsl:when test="@content">
  478.           <A ><xsl:attribute name="href">http://apps.xmlschema.com/schemaDoc/xdrref.htm#content_<xsl:value-of select="@content"></xsl:value-of></xsl:attribute>
  479.             <xsl:value-of select="@content"></xsl:value-of></A>
  480.         </xsl:when>
  481.         <xsl:otherwise>
  482.           <A href="#content_mixed">mixed</A> (default)
  483.         </xsl:otherwise>
  484.       </xsl:choose>
  485.                             </td>
  486.                         </tr>
  487.  
  488.                         <tr>
  489.                             <td width="15%" bgcolor="#CCCCCC" align="right" valign="top">
  490.                                 <span class="names">order</span>
  491.                             </td>
  492.                             <td width="85%"  class="values" bgcolor="#eeeeee" >
  493.  
  494.       <xsl:choose>
  495.         <xsl:when test="@dt:type">
  496.           <SPAN class="note">Ignored when a datatype is specified.</SPAN>
  497.         </xsl:when>
  498.         <xsl:when test="@order">
  499.           <A><xsl:attribute name="href">http://apps.xmlschema.com/schemaDoc/xdrref.htm#order_<xsl:value-of select="@order"/></xsl:attribute>
  500.             <xsl:value-of select="@order"/></A>
  501.         </xsl:when>
  502.         <xsl:otherwise>
  503.           <A href="http://apps.xmlschema.com/schemaDoc/xdrref.htm#order_many">many</A> (default)
  504.         </xsl:otherwise>
  505.       </xsl:choose>                    
  506.                             </td>
  507.                         </tr>
  508.  
  509.                         <tr>
  510.                             <td width="15%" bgcolor="#CCCCCC" align="right" valign="top">
  511.                                 <span class="names">model</span>
  512.                             </td>
  513.                             <td width="85%"  class="values" bgcolor="#eeeeee" >
  514.  
  515.       <xsl:choose>
  516.         <xsl:when test="@dt:type">
  517.           Treated as <A class="reference-link" href="#model_closed">closed</A> when a datatype is specified.
  518.         </xsl:when>
  519.         <xsl:when test="@model">
  520.           <A ><xsl:attribute name="href">http://apps.xmlschema.com/schemaDoc/xdrref.htm#model_<xsl:value-of select="@model"></xsl:value-of></xsl:attribute>
  521.             <xsl:value-of select="@model"></xsl:value-of></A>
  522.         </xsl:when>
  523.         <xsl:otherwise>
  524.           <A href="http://apps.xmlschema.com/schemaDoc/xdrref.htm#model_open">open</A> (default)
  525.         </xsl:otherwise>
  526.       </xsl:choose>                    
  527.                             </td>
  528.                         </tr>
  529.  
  530.                     </table>
  531.                 </td>
  532.             </tr>
  533.         </table>
  534.         <xsl:if test="s:AttributeType">
  535.             <table width="90%" cellspacing="0" cellpadding="0" border="0"  bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  536.                 <tr>
  537.                     <td width="3%" bgcolor="#8888ff" align="left" valign="top">†</td>
  538.                     <td width="97%" align="left" valign="top">
  539.                         <table width="100%" cellspacing="3" cellpadding="1" border="0"  align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
  540.                             <tr>
  541.                                 <th width="15%" bgcolor="#CCCCCC" align="right" valign="top">
  542.                                     <span class="headers">Attribute</span>
  543.                                 </th>
  544.                                 <th width="20%" bgcolor="#CCCCCC" align="left" >
  545.                                     <span class="headers">Datatype</span>
  546.                                 </th>
  547.                                 <th width="20%" bgcolor="#CCCCCC" align="left" >
  548.                                     <span class="headers">Required</span>
  549.                                 </th>
  550.                                 <th width="25%" bgcolor="#CCCCCC" align="left"  >
  551.                                     <span class="headers">Values</span>
  552.                                 </th>
  553.                                 <th width="20%" bgcolor="#CCCCCC" align="left" >
  554.                                     <span class="headers">Default</span>
  555.                                 </th>
  556.    <!--                                <th width="15%" bgcolor="#eeeeee">
  557.                                     <span class="headers">minOccurs</span>
  558.                                 </th>
  559.                                 <th width="15%" bgcolor="#eeeeee">
  560.                                     <span class="headers">maxOccurs</span>
  561.                                 </th>
  562.                     <th width="15%" class="headers" bgcolor="#eeeeee">
  563.                                     
  564.                                         source
  565.                                     
  566.                                 </th>
  567.                 -->
  568.                             </tr>
  569.                             <xsl:apply-templates mode="detailAttrib" select="s:AttributeType"/>
  570.                         </table>
  571.                         </td>
  572.                     </tr>
  573.                 </table>
  574.         </xsl:if>
  575.         <table width="90%" cellspacing="0" cellpadding="0" border="0"  bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
  576.                 <tr>
  577.                     <td width="3%" bgcolor="#bbbbbb" align="left" valign="top">†</td>
  578.                     <td width="97%" align="left" valign="top">
  579.                         <table width="100%" cellspacing="3" cellpadding="1" border="0"  align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
  580.  
  581.                         <tr>
  582.                             <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
  583.                                 source
  584.                             </td>
  585.                             <td width="85%" class="source" bgcolor="#eeeeeeee" align="left" valign="top">
  586.                                     <xsl:apply-templates mode="copy" select="current()"/>
  587.                             </td>
  588.                         </tr>
  589.                     </table>
  590.                     </td>
  591.                 </tr>
  592.             </table>
  593.         <p/>
  594.     </xsl:template>
  595.  
  596.     <xsl:template mode="glanceAttrib" match="s:attribute">
  597.         <xsl:value-of select="@type"/>  
  598.     </xsl:template>
  599.  
  600.     <xsl:template mode="detailAttrib" match="s:AttributeType">
  601.         <tr>
  602.             <td width="15%" bgcolor="#CCCCCC" align="right" valign="top">
  603.                 <span class="headers">
  604.                     <b>
  605.                         <xsl:value-of select="@name"/>
  606.                     </b>
  607.                 </span>
  608.             </td>
  609.             <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
  610.                 <A ><xsl:attribute name="href">http://apps.xmlschema.com/schemaDoc/xdrref.htm#datatype_<xsl:value-of select="@dt:type"/></xsl:attribute>
  611.                         <xsl:value-of select="@dt:type"/></A>
  612.             </td>
  613.             <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
  614.       <xsl:choose>
  615.         <xsl:when test="@required">
  616.           <xsl:value-of select="@required"/>
  617.         </xsl:when>
  618.         <xsl:otherwise>
  619.           no (default)
  620.         </xsl:otherwise>
  621.       </xsl:choose>
  622.             </td>
  623.             <td width="25%" class="values" bgcolor="#eeeeee" align="left" valign="top">
  624.  
  625. <xsl:value-of  select="@dt:values"/>
  626. <!--<xsl:for-each select="@dt:values">
  627.     <xsl:value-of disable-output-escaping="yes" select="local:writeEnumeration(.)" />
  628. </xsl:for-each>
  629.     -->        </td>
  630.         
  631.             <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
  632.  
  633.                     <xsl:value-of select="@default"/>
  634.             </td>
  635.  
  636. <!--    <td width="85%" bgcolor="#eeeeeeee" align="left" valign="top">
  637.                 <span class="Paragraph">
  638.                     <xsl:apply-templates mode="copy" select="current()"/>
  639.                 </span>
  640.             </td>
  641.             -->
  642.         </tr>
  643.     </xsl:template>
  644.  
  645.  
  646.     <!-- END detailattributetype TYPE -->
  647.  
  648.     <xsl:template mode="anElement" match="s:element">
  649.         <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="@type"/></xsl:attribute><xsl:value-of select="@type"/>
  650.         </A>  
  651.           <xsl:if test="position()!=last()">, </xsl:if>
  652.     </xsl:template>
  653.  
  654.     <xsl:template match="s:description" mode="schemacomments">
  655.          
  656.         <xsl:choose> 
  657.         <xsl:when test="not(@usage='USAGE')">
  658.                  <xsl:value-of select="text()"/>
  659.         </xsl:when> 
  660.         </xsl:choose>   
  661.             <!--<xsl:apply-templates mode="comments" />-->
  662.     </xsl:template>
  663.     
  664.     <xsl:template match="s:description" mode="usagecomments">
  665.         <xsl:choose> 
  666.         <xsl:when test="@usage='USAGE'">
  667.                  <xsl:value-of select="text()"/>
  668.         </xsl:when> 
  669.         </xsl:choose>   
  670.     </xsl:template>
  671.  
  672. <!--
  673. <xsl:template mode="copy" match="*|@*|comment()|processing-instruction()|text()">
  674.   <xsl:copy>
  675.     <xsl:apply-templates mode="copy" 
  676.      select="*|@*|comment()|processing-instruction()|text()"/>
  677.   </xsl:copy>
  678. </xsl:template>
  679. -->
  680.     <!-- ***********************SOURCE part...copied from lotus*****************-->
  681.  
  682. <!-- Templates for each node type follows.  The output of each template has a similar structure
  683.   to enable script to walk the result tree easily for handling user interaction. -->
  684.   
  685. <!-- Template for pis not handled elsewhere -->
  686. <xsl:template mode="copy" match="processing-instruction()">
  687.   <DIV class="e">
  688.   <SPAN class="b"> </SPAN>
  689.   <SPAN class="m"><?</SPAN><SPAN class="pi"><xsl:value-of select="name(.)"/> <xsl:value-of select="."/></SPAN><SPAN class="m">?></SPAN>
  690.   </DIV>
  691. </xsl:template>
  692.  
  693. <!-- Template for the XML declaration.  Need a separate template because the pseudo-attributes
  694.     are actually exposed as attributes instead of just element content, as in other pis 
  695. <xsl:template mode="copy" match="processing-instruction('xml')">
  696.   <DIV class="e">
  697.   <SPAN class="b"> </SPAN>
  698.   <SPAN class="m"><?</SPAN><SPAN class="pi">xml <xsl:for-each select="@*"><xsl:value-of select="name(.)"/>="<xsl:value-of select="."/>" </xsl:for-each></SPAN><SPAN class="m">?></SPAN>
  699.   </DIV>
  700. </xsl:template>
  701. -->
  702.  
  703. <!-- Template for attributes not handled elsewhere -->
  704. <xsl:template mode="copy" match="@*"><SPAN class=".xdra"><xsl:text> </xsl:text><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
  705.  
  706. <!-- Template for attributes in the xmlns or xml namespace
  707. <xsl:template mode="copy"match="@xmlns:*|@xmlns|@xml:*"><SPAN class="ns"> <xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B class="ns"><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
  708. -->
  709.  
  710. <!-- Template for text nodes -->
  711. <xsl:template  mode="copy" match="text()">
  712.   <xsl:choose><xsl:when test="name(.) = '#cdata-section'"><xsl:call-template name="cdata"/></xsl:when>
  713.   <xsl:otherwise><DIV class="e">
  714.   <SPAN class="b"> </SPAN>
  715.   <SPAN class="tx"><xsl:value-of select="."/></SPAN>
  716.   </DIV></xsl:otherwise></xsl:choose>
  717. </xsl:template>
  718.   
  719. <!-- Template for comment nodes -->
  720. <xsl:template mode="copy" match="comment()">
  721.   <DIV class="k">
  722.   <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m"><!--</SPAN></SPAN>
  723.   <SPAN id="clean" class="ci"><PRE><xsl:value-of select="."/></PRE></SPAN>
  724.   <SPAN class="b"> </SPAN> <SPAN class="m">--></SPAN>
  725.   <SCRIPT>f(clean);</SCRIPT></DIV>
  726. </xsl:template>
  727.  
  728. <!-- Template for cdata nodes -->
  729. <xsl:template  name="cdata">
  730.   <DIV class="k">
  731.   <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m"><![CDATA[</SPAN></SPAN>
  732.   <SPAN id="clean" class="di"><PRE><xsl:value-of select="."/></PRE></SPAN>
  733.   <SPAN class="b"> </SPAN> <SPAN class="m">]]></SPAN>
  734.   <SCRIPT>f(clean);</SCRIPT></DIV>
  735. </xsl:template>
  736.  
  737. <!-- Template for elements not handled elsewhere (leaf nodes) -->
  738. <xsl:template mode="copy"  match="*">
  739.   <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
  740.   <SPAN class="b"> </SPAN>
  741.   <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN> <xsl:apply-templates  mode="copy" select="@*"/><SPAN class="m"> /></SPAN>
  742.   </DIV></DIV>
  743. </xsl:template>
  744.  
  745. <!-- Template for elements not handled elsewhere (leaf nodes) -->
  746. <xsl:template mode="copy"  match="s:AttributeType | s:attribute">
  747.   <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
  748.   <SPAN class="b"> </SPAN>
  749.   <SPAN class="m"><</SPAN><SPAN class="t"><font color="#993333"><xsl:value-of select="name(.)"/></font></SPAN> <xsl:apply-templates  mode="copy" select="@*"/><SPAN class="m"> /></SPAN>
  750.   </DIV></DIV>
  751. </xsl:template>
  752.  
  753.  
  754. <!-- Template for elements with comment, pi and/or cdata children
  755. <xsl:template  mode="copy" match="*[comment() or processing-instruction() or cdata()]">
  756.   <DIV class="e">
  757.   <DIV class="c"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates  mode="copy" select="@*"/> <SPAN class="m">></SPAN></DIV>
  758.   <DIV><xsl:apply-templates  mode="copy" />
  759.   <DIV><SPAN class="b"> </SPAN> <SPAN class="m"></</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN></DIV>
  760.   </DIV></DIV>
  761. </xsl:template> -->
  762.  
  763. <!-- Template for elements with only text children -->
  764. <xsl:template mode="copy"  match="*[text() and not(comment() or processing-instruction() or *)]">
  765.   <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
  766.   <SPAN class="b"> </SPAN> <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates  mode="copy" select="@*"/>
  767.   <SPAN class="m">></SPAN><SPAN class="tx"><xsl:value-of select="."/></SPAN><SPAN class="m"></</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN>
  768.   </DIV></DIV>
  769. </xsl:template>
  770.  
  771. <!-- Template for elementstypes -->
  772. <xsl:template mode="copy"  match="s:ElementType | s:element">
  773.   <DIV class="e">
  774.   <DIV class="c" STYLE="margin-left:1em;text-indent:-2em"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN><SPAN class="et"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates  mode="copy" select="@*"/><SPAN class="m">></SPAN></DIV>
  775.   <DIV><xsl:apply-templates  mode="copy" />
  776.   <DIV><SPAN class="b"> </SPAN><SPAN class="m"></</SPAN><SPAN class="et"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN></DIV>
  777.   </DIV></DIV>
  778. </xsl:template>
  779.  
  780.  
  781. <!-- Template for elements with element children -->
  782. <xsl:template mode="copy"  match="s:Schema">
  783.   <DIV class="e">
  784.   <DIV class="c" STYLE="margin-left:1em;text-indent:-2em"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates  mode="copy" select="@*"/><SPAN class="m">></SPAN></DIV>
  785.   <DIV><xsl:apply-templates  mode="copy" />
  786.   <DIV><SPAN class="b"> </SPAN><SPAN class="m"></</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN></DIV>
  787.   </DIV></DIV>
  788. </xsl:template>
  789.     function writeEnumeration(_contextNodeList)
  790.     {
  791.       var __this = _contextNodeList.item(0);
  792.       return formatEnum(__this, __this.selectSingleNode("../@default"));
  793.     }
  794.     
  795. </xsl:stylesheet>
  796.