odmlDocument.xsl 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
  4. xmlns:odml="http://www.g-node.org/odml">
  5. <!-- This stylesheet is meant to view odml-templates in a web browser -->
  6. <!-- Please note: only template related elements will be displayed -->
  7. <!-- Elements like uncertainty, id or value will not be shown -->
  8. <!-- ************************************************ -->
  9. <!-- root template -->
  10. <xsl:template match="odML">
  11. <!-- if there is a base url definition read it and later pass it to the sections template -->
  12. <xsl:variable name="repository" select="repository"/>
  13. <html>
  14. <head>
  15. <meta charset="utf-8" />
  16. <title>odML | Open metadata markup language - Templates and Terminologies -</title>
  17. <meta name="description"
  18. content="Templates and Terminologies for the storage of scientific metadata" />
  19. <link rel="stylesheet" href="https://terminologies.g-node.org/_resources/odml_style.css" />
  20. <link rel="icon" href="https://terminologies.g-node.org/images/odMLIcon.png" />
  21. </head>
  22. <body>
  23. <header>
  24. <h1><a class="white" href="https://terminologies.g-node.org/index.html">odML metadata terminology</a></h1>
  25. </header>
  26. <div class="navWrapper">
  27. <navigationContainer>
  28. <div id="navigationContainer">
  29. <hr class="fatline" />
  30. <p>
  31. <h2>Document info</h2>
  32. <b>Author: </b><xsl:if test="author"><xsl:value-of select="author"/></xsl:if><br/>
  33. <b>Date: </b><xsl:if test="date"><xsl:value-of select="date"/></xsl:if><br/>
  34. <b>Version: </b><xsl:if test="version"><xsl:value-of select="version"/></xsl:if><br/>
  35. <b>Repository: </b><xsl:if test="repository"><xsl:value-of select="repository"/></xsl:if><br/>
  36. </p>
  37. <hr class="fatline" />
  38. <h2>Structure</h2>
  39. <font size ="-1" >
  40. <xsl:if test="section">
  41. <xsl:for-each select="section">
  42. <xsl:call-template name="sectionTemplate">
  43. <xsl:with-param name="navigation">1</xsl:with-param>
  44. <xsl:with-param name="anchorBase">Sec</xsl:with-param>
  45. <xsl:with-param name="url" select="$repository"/>
  46. </xsl:call-template>
  47. </xsl:for-each>
  48. </xsl:if>
  49. </font>
  50. <br/>
  51. </div>
  52. <div id="contentContainer">
  53. <hr class="fatline" />
  54. <h2>Content</h2>
  55. <!-- apply the section template -->
  56. <xsl:if test="section">
  57. <xsl:for-each select="section">
  58. <xsl:call-template name="sectionTemplate">
  59. <xsl:with-param name="navigation">0</xsl:with-param>
  60. <xsl:with-param name="anchorBase">Sec</xsl:with-param>
  61. <xsl:with-param name="url" select="$repository"/>
  62. </xsl:call-template>
  63. </xsl:for-each>
  64. </xsl:if>
  65. </div>
  66. </navigationContainer>
  67. </div>
  68. </body>
  69. </html>
  70. </xsl:template>
  71. <!-- ************************************************ -->
  72. <!-- section template. -->
  73. <xsl:template name="sectionTemplate" match="section">
  74. <xsl:param name="navigation"/>
  75. <xsl:param name="anchorBase"/>
  76. <xsl:param name="url"/>
  77. <xsl:variable name="anchorName" select="concat($anchorBase,position())"/>
  78. <!-- set new repository if specified within this section otherwise use the old one -->
  79. <xsl:variable name="repository">
  80. <xsl:choose>
  81. <xsl:when test="repository">
  82. <xsl:value-of select ="repository"/>
  83. </xsl:when>
  84. <xsl:otherwise>
  85. <xsl:value-of select ="$url"/>
  86. </xsl:otherwise>
  87. </xsl:choose>
  88. </xsl:variable>
  89. <!-- print out the content -->
  90. <xsl:choose>
  91. <!-- fill the navigation container if this is the task (navigation param = 1) -->
  92. <xsl:when test="$navigation = 1">
  93. <!-- create a link to the anchor in the content container -->
  94. <ol class="nested">
  95. <font size="normal"><a href="#{$anchorName}">
  96. <xsl:value-of select="name"/> (type: <xsl:value-of select="type"/>)
  97. </a></font>
  98. <!-- recursive call if there are subsections -->
  99. <xsl:if test="section">
  100. <xsl:for-each select="section">
  101. <xsl:call-template name="sectionTemplate">
  102. <xsl:with-param name="navigation" select="$navigation"/>
  103. <xsl:with-param name="anchorBase" select="concat($anchorName,'SubSec')"/>
  104. <xsl:with-param name="url" select="$repository"/>
  105. </xsl:call-template>
  106. </xsl:for-each>
  107. </xsl:if>
  108. </ol>
  109. </xsl:when>
  110. <!-- otherwise use template to display the content (navigation !=1) -->
  111. <xsl:otherwise>
  112. <a name="{$anchorName}"><h3> <xsl:value-of select="name"/> Section</h3></a>
  113. <p>
  114. <b>Type: </b><xsl:value-of select="type"/><br/>
  115. <xsl:choose>
  116. <xsl:when test ="repository">
  117. <b>Repository: </b><xsl:value-of select="repository"/><br/>
  118. </xsl:when>
  119. <xsl:otherwise>
  120. <b>Repository: </b><xsl:value-of select="$repository"/><br/>
  121. </xsl:otherwise>
  122. </xsl:choose>
  123. <b>Link: </b><xsl:if test="link"><xsl:value-of select="link"/></xsl:if><br/>
  124. <b>Include:</b> <xsl:if test="include"><font color="red"><xsl:value-of select="include"/></font></xsl:if><br/>
  125. <b>Definition: </b><xsl:if test="definition"><xsl:value-of select="definition"/></xsl:if><br/>
  126. </p>
  127. <!-- Check if there are any properties -->
  128. <xsl:if test="property">
  129. <table border="1" rules="rows" width="100%"><font size="-1">
  130. <tr bgcolor="#336699" align="left" valign="middle">
  131. <th><font size="+1" color="white"><b>Name</b></font></th>
  132. <th><font size="+1" color="white"><b>Value</b></font></th>
  133. <th><font size="+1" color="white"><b>Unit</b></font></th>
  134. <th><font size="+1" color="white"><b>Type</b></font></th>
  135. <th><font size="+1" color="white"><b>Definition</b></font></th>
  136. <th><font size="+1" color="white"><b>Dependency</b></font></th>
  137. <th><font size="+1" color="white"><b>Dependency Value</b></font></th>
  138. </tr>
  139. <xsl:for-each select="property">
  140. <xsl:variable name="anchor">
  141. <xsl:value-of select ="name"/>
  142. </xsl:variable>
  143. <tr>
  144. <td width="15%"><a name="{$anchor}"/>
  145. <p><xsl:value-of select="name"/></p>
  146. </td>
  147. <td width="10%"><p><xsl:value-of select="value"/></p></td>
  148. <td width="5%"><p><xsl:value-of select="unit"/><br/></p></td>
  149. <td width="5%"><p><xsl:value-of select="type"/></p></td>
  150. <td width="22.5%"><p><xsl:value-of select="definition"/></p></td>
  151. <td width="5%"><p><xsl:value-of select="dependency"/></p></td>
  152. <td width="5%"><p><xsl:value-of select="dependencyValue"/></p></td>
  153. </tr>
  154. </xsl:for-each></font>
  155. </table>
  156. </xsl:if>
  157. <a href="#top"><tiny>top</tiny></a>
  158. <hr class="thinline" />
  159. <!-- recursive call if there are subsections -->
  160. <xsl:if test="section">
  161. <xsl:for-each select="section">
  162. <xsl:call-template name="sectionTemplate">
  163. <xsl:with-param name="navigation" select="$navigation"/>
  164. <xsl:with-param name="anchorBase" select="concat($anchorName,'SubSec')"/>
  165. <xsl:with-param name="url" select="$repository"/>
  166. </xsl:call-template>
  167. </xsl:for-each>
  168. </xsl:if>
  169. </xsl:otherwise>
  170. </xsl:choose>
  171. </xsl:template>
  172. </xsl:stylesheet>