home *** CD-ROM | disk | FTP | other *** search
/ ftp.tcs3.com / ftp.tcs3.com.tar / ftp.tcs3.com / DRIVERS / Audio / Office2010 / InfoPath.en-us / InfLR.cab / FL_disco_xsl_ENU____.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Extensible Markup Language  |  2009-05-23  |  5KB  |  107 lines

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:disco="http://schemas.xmlsoap.org/disco/" xmlns:scl="http://schemas.xmlsoap.org/disco/scl/"
  3.      xmlns:xsd="http://www.w3.org/2001/XMLSchema/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:s="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="disco scl ms s xsi xsd">
  4.     <xsl:output method="html" />
  5.     <xsl:template match="/">
  6.         <h1 class="listpage" _locID="L_string01_Text">Discovery Page</h1>
  7.         <p class="listpage" _locID="L_string02_Text">This discovery document represents a
  8.             group of web services (e.g. service.wsdl), datasets (e.g. dataset.xsd), and
  9.             other discovery documents (e.g. group.disco) that may be consumed together. </p>
  10.         <h3 _locID="L_string03_Text">Web Service Group contents:</h3>
  11.         <table class="listpage" borderColor="#ffffff" cellSpacing="0" cellPadding="0" rules="rows" width="100%" align="center" frame="void">
  12.             <xsl:choose>
  13.                 <xsl:when test="disco:discovery/scl:contractRef">
  14.                     <tr valign="center" align="left">
  15.                         <td class="tbltext">
  16.                             <table borderColor="#ffffff" cellSpacing="0" cellPadding="3" rules="rows" width="100%" border="1" frame="void">
  17.                                 <tr>
  18.                                     <td class="header" _locID="L_string04_Text">Services</td>
  19.                                 </tr>
  20.                                 <xsl:for-each select="disco:discovery/scl:contractRef">
  21.                                     <xsl:sort select="@ref" />
  22.                                     <tr vAlign="center">
  23.                                         <td class="tbltext">
  24.                                             <xsl:value-of select="@ref" /><br />
  25.                                                 <a _locID="L_string05_Text"><xsl:call-template name ="writeHrefAttrib"> <xsl:with-param name="url" select="@ref" /></xsl:call-template>View Service</a>
  26.                                                  <a _locID="L_string06_Text"><xsl:call-template name ="writeHrefAttrib"> <xsl:with-param name="url" select="@docRef" /></xsl:call-template>View Documentation</a>
  27.                                         </td>
  28.                                     </tr>
  29.                                 </xsl:for-each>
  30.                             </table>
  31.                         </td>
  32.                     </tr>
  33.                     <tr>
  34.                         <td class="spacer" bgColor="white" height="5"> </td>
  35.                     </tr>
  36.                 </xsl:when>
  37.             </xsl:choose>
  38.             <xsl:choose>
  39.                 <xsl:when test="disco:discovery/scl:schemaRef">
  40.                     <tr valign="center" align="left">
  41.                         <td class="tbltext">
  42.                             <table borderColor="#ffffff" cellSpacing="0" cellPadding="3" rules="rows" width="100%" border="1" frame="void">
  43.                                 <tr>
  44.                                     <td class="header" _locID="L_string07_Text">DataSets</td>
  45.                                 </tr>
  46.                                 <xsl:for-each select="disco:discovery/scl:schemaRef">
  47.                                     <xsl:sort select="@ref" />
  48.                                     <tr valign="center">
  49.                                         <td class="tbltext"><xsl:value-of select="@ref" /><br /><a _locID="L_string08_Text"><xsl:call-template name ="writeHrefAttrib"> <xsl:with-param name="url" select="@ref" /></xsl:call-template><BR/>View Schema</a>
  50.                                         </td>
  51.                                     </tr>
  52.                                     </xsl:for-each>
  53.                             </table>
  54.                         </td>
  55.                     </tr>
  56.                     <tr>
  57.                         <td class="spacer" bgColor="white" height="5"> </td>
  58.                     </tr>
  59.                 </xsl:when>
  60.             </xsl:choose>
  61.             <xsl:choose>
  62.                 <xsl:when test="disco:discovery/scl:discoveryRef">
  63.                     <tr valign="center" align="left">
  64.                         <td class="tbltext">
  65.                             <table borderColor="#ffffff" cellSpacing="0" cellPadding="3" rules="rows" width="100%" border="1" frame="void">
  66.                                 <tr>
  67.                                     <td class="header" _locID="L_string09_Text">Discovery Documents</td>
  68.                                 </tr>
  69.                                 <xsl:for-each select="disco:discovery/scl:discoveryRef">
  70.                                     <xsl:sort select="@ref" />
  71.                                     <tr valign="center">
  72.                                         <td class="tbltext"><xsl:value-of select="@ref" /><br /><a _locID="L_string10_Text"><xsl:call-template name ="writeHrefAttrib"> <xsl:with-param name="url" select="@ref" /></xsl:call-template><BR/>View Discovery Document</a>
  73.                                         </td>
  74.                                     </tr>
  75.                                     </xsl:for-each>
  76.                             </table>
  77.                         </td>
  78.                     </tr>
  79.                     <tr>
  80.                         <td class="spacer" bgColor="white" height="5"> </td>
  81.                     </tr>
  82.                 </xsl:when>
  83.             </xsl:choose>
  84.             <xsl:choose>
  85.                 <xsl:when test="disco:discovery/scl:contractRef | disco:discovery/scl:schemaRef | disco:discovery/scl:discoveryRef"></xsl:when>
  86.                 <xsl:otherwise>
  87.                     <tr valign="center">
  88.                         <td class="tbltext" _locID="L_string11_Text">No Web References were defined by this discovery document.</td>
  89.                     </tr>
  90.                 </xsl:otherwise>
  91.             </xsl:choose>
  92.         </table>
  93.     </xsl:template>
  94.     
  95.     <xsl:template name="writeHrefAttrib">
  96.         <xsl:param name="url" />
  97.         <xsl:variable name="urllower" select="normalize-space(translate($url,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))" />
  98.             <xsl:choose>
  99.                 <xsl:when test="starts-with($urllower,'http:') or starts-with($urllower,'https:') or starts-with($urllower,'ftp:')">
  100.                     <xsl:attribute name="href">
  101.                         <xsl:value-of select="$url" />
  102.                     </xsl:attribute>
  103.                 </xsl:when>
  104.             </xsl:choose>
  105.     </xsl:template>
  106. </xsl:stylesheet>
  107.