[16] | 1 | <?xml version="1.0" encoding="utf-8"?> |
---|
| 2 | <xsl:stylesheet |
---|
| 3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
| 4 | xmlns:witsml="http://www.witsml.org/schemas/131" |
---|
| 5 | version="1.0"> |
---|
| 6 | |
---|
| 7 | <xsl:output method="html"/> |
---|
| 8 | |
---|
| 9 | <xsl:template match="/"> |
---|
| 10 | <html> |
---|
| 11 | <head> |
---|
| 12 | <link rel="stylesheet" href="witsml.css" type="text/css"/> |
---|
| 13 | </head> |
---|
| 14 | <body> |
---|
| 15 | <xsl:for-each select="witsml:wellLogs/witsml:wellLog"> |
---|
| 16 | <table align="center"> |
---|
| 17 | <tr> |
---|
| 18 | <th class="mainheader" colspan="6">WITSML Well Log</th> |
---|
| 19 | </tr> |
---|
| 20 | <tr> |
---|
| 21 | <td class="label">Well Name:</td> |
---|
| 22 | <td class="dataval"><xsl:value-of select="witsml:nameWell"/> </td> |
---|
| 23 | <td> </td> |
---|
| 24 | <td class="label">Well Identifier</td> |
---|
| 25 | <td class="dataval"><xsl:value-of select="@uidWell"/> </td> |
---|
| 26 | <td> </td> |
---|
| 27 | </tr> |
---|
| 28 | <tr> |
---|
| 29 | <td class="label">Wellbore Name</td> |
---|
| 30 | <td class="dataval"><xsl:value-of select="witsml:nameWellbore"/> </td> |
---|
| 31 | <td> </td> |
---|
| 32 | <td class="label">Wellbore Identifier</td> |
---|
| 33 | <td class="dataval"><xsl:value-of select="@uidWellbore"/> </td> |
---|
| 34 | <td> </td> |
---|
| 35 | </tr> |
---|
| 36 | <tr> |
---|
| 37 | <td class="label">Log Name</td> |
---|
| 38 | <td class="dataval"><xsl:value-of select="witsml:name"/> </td> |
---|
| 39 | <td> </td> |
---|
| 40 | <td class="label">Log Identifier</td> |
---|
| 41 | <td class="dataval"><xsl:value-of select="@uid"/> </td> |
---|
| 42 | <td> </td> |
---|
| 43 | </tr> |
---|
| 44 | <tr> |
---|
| 45 | <td class="label">Service Company</td> |
---|
| 46 | <td class="dataval"><xsl:value-of select="witsml:serviceCompany"/></td> |
---|
| 47 | <td> </td> |
---|
| 48 | <td class="label">Run Number</td> |
---|
| 49 | <td class="dataval"><xsl:value-of select="witsml:runNumber"/> </td> |
---|
| 50 | <td> </td> |
---|
| 51 | </tr> |
---|
| 52 | <tr> |
---|
| 53 | <td class="label">Description</td> |
---|
| 54 | <td class="dataval"><xsl:value-of select="witsml:description"/> </td> |
---|
| 55 | <td> </td> |
---|
| 56 | <td class="label">Creation Date</td> |
---|
| 57 | <td class="dataval"><font size="-1"> |
---|
| 58 | <xsl:call-template name="formatdate"> |
---|
| 59 | <xsl:with-param name="strDate" select="witsml:creationDate"/> |
---|
| 60 | </xsl:call-template> |
---|
| 61 | </font> </td> |
---|
| 62 | <td> </td> </tr> |
---|
| 63 | <tr> |
---|
| 64 | <td class="label">Index</td> |
---|
| 65 | <td class="dataval"><xsl:value-of select="witsml:indexType"/> </td> |
---|
| 66 | <td> </td> |
---|
| 67 | </tr> |
---|
| 68 | <tr> |
---|
| 69 | <td class="label">Minimum Index</td> |
---|
| 70 | <td class="dataval"><xsl:value-of select="witsml:minIndex"/> </td> |
---|
| 71 | <td><xsl:apply-templates select="witsml:indexUnits" mode="UnitRef"/> </td> |
---|
| 72 | <td class="label">Maximum Index</td> |
---|
| 73 | <td class="dataval"><xsl:value-of select="witsml:maxIndex"/> </td> |
---|
| 74 | <td><xsl:apply-templates select="witsml:indexUnits" mode="UnitRef"/> </td> |
---|
| 75 | </tr> |
---|
| 76 | <xsl:for-each select="witsml:comment"> |
---|
| 77 | <tr><th colspan="6">Comment</th> </tr> |
---|
| 78 | <tr><td><xsl:value-of select="."/> </td> </tr> |
---|
| 79 | </xsl:for-each> |
---|
| 80 | |
---|
| 81 | <!-- |
---|
| 82 | Output Log Header Parameters if there are any |
---|
| 83 | --> |
---|
| 84 | <xsl:choose> |
---|
| 85 | <xsl:when test="logHeaderParam"> |
---|
| 86 | <tr><th colspan="6">Log Header Parameters</th> </tr> |
---|
| 87 | |
---|
| 88 | <tr><td colspan="6" align="center"><table align="center"> |
---|
| 89 | <tr><th>Index</th> |
---|
| 90 | <th>Name</th> |
---|
| 91 | <th>Value</th> |
---|
| 92 | <th>Units</th> |
---|
| 93 | <th colspan="2">Description</th> </tr> |
---|
| 94 | <xsl:for-each select="witsml:logHeaderParam"> |
---|
| 95 | <tr class="listtable"> |
---|
| 96 | <td align="center"><xsl:value-of select="@index"/> </td> |
---|
| 97 | <td align="center"><xsl:value-of select="@name"/> </td> |
---|
| 98 | |
---|
| 99 | <td align="center"><xsl:value-of select="."/> </td> |
---|
| 100 | <td align="center"><xsl:apply-templates select="." mode="UomRef"/></td> |
---|
| 101 | <td align="center"><xsl:value-of select="@description"/> </td> |
---|
| 102 | </tr> |
---|
| 103 | </xsl:for-each> |
---|
| 104 | </table> <br/> </td> </tr> |
---|
| 105 | </xsl:when> |
---|
| 106 | </xsl:choose> |
---|
| 107 | |
---|
| 108 | <!-- |
---|
| 109 | Output Log Curve Info Data |
---|
| 110 | --> |
---|
| 111 | <tr><th colspan="8">Log Curve Information</th> </tr> |
---|
| 112 | |
---|
| 113 | <tr><td colspan="8" align="center"> |
---|
| 114 | <table align="center"> |
---|
| 115 | <tr> |
---|
| 116 | <th>Mnemonic</th> |
---|
| 117 | <th>Classification</th> |
---|
| 118 | <th>Units</th> |
---|
| 119 | <th>Alias</th> |
---|
| 120 | <th>Null Value</th> |
---|
| 121 | <th>State</th> |
---|
| 122 | <th>Type</th> |
---|
| 123 | <th>Description</th> |
---|
| 124 | <th>Axes</th> |
---|
| 125 | </tr> |
---|
| 126 | <xsl:for-each select="witsml:logCurveInfo"> |
---|
| 127 | <xsl:sort select="witsml:columnIndex" data-type="number"/> |
---|
| 128 | <a name='curve_{position()}'> |
---|
| 129 | <xsl:value-of select="witsml:curveId"/> |
---|
| 130 | </a> |
---|
| 131 | <tr class="listtable"> |
---|
| 132 | <td align="center"><xsl:value-of select="witsml:mnemonic"/> </td> |
---|
| 133 | <td align="center"><xsl:apply-templates select="witsml:classWitsml" mode="RealTimeData"/> </td> |
---|
| 134 | <td align="center"><xsl:apply-templates select="witsml:unit" mode="UnitRef"/> </td> |
---|
| 135 | <td align="center"><xsl:value-of select="witsml:mnemAlias"/> </td> |
---|
| 136 | <td align="center"><xsl:value-of select="witsml:nullValue"/> </td> |
---|
| 137 | <td align="center"><xsl:value-of select="witsml:traceState"/> </td> |
---|
| 138 | <td align="center"><xsl:value-of select="witsml:typeLogData"/> </td> |
---|
| 139 | <td align="center"><xsl:value-of select="witsml:curveDescription"/></td> |
---|
| 140 | <td align="center"> |
---|
| 141 | <xsl:if test="witsml:axisDefinition"> |
---|
| 142 | <table border='3'> |
---|
| 143 | |
---|
| 144 | <tr><th><font size='-2'>count</font></th> |
---|
| 145 | <xsl:for-each select="witsml:axisDefinition"> |
---|
| 146 | <td><font size='-2'> |
---|
| 147 | <xsl:value-of select="witsml:count"/> |
---|
| 148 | </font></td> |
---|
| 149 | </xsl:for-each></tr> |
---|
| 150 | |
---|
| 151 | <tr><th><font size='-2'>name</font></th> |
---|
| 152 | <xsl:for-each select="witsml:axisDefinition"> |
---|
| 153 | <td><font size='-2'> |
---|
| 154 | <xsl:value-of select="witsml:name"/> |
---|
| 155 | </font></td> |
---|
| 156 | </xsl:for-each></tr> |
---|
| 157 | |
---|
| 158 | <tr><th><font size='-2'>pty type</font></th> |
---|
| 159 | <xsl:for-each select="witsml:axisDefinition"> |
---|
| 160 | <td><font size='-2'> |
---|
| 161 | <xsl:value-of select="witsml:propertyType"/> |
---|
| 162 | </font></td> |
---|
| 163 | </xsl:for-each></tr> |
---|
| 164 | |
---|
| 165 | <tr><th><font size='-2'>uom</font></th> |
---|
| 166 | <xsl:for-each select="witsml:axisDefinition"> |
---|
| 167 | <td><font size='-2'> |
---|
| 168 | <xsl:value-of select="witsml:uom"/> |
---|
| 169 | </font></td> |
---|
| 170 | </xsl:for-each></tr> |
---|
| 171 | |
---|
| 172 | <tr><th><font size='-2'>coords</font></th> |
---|
| 173 | <xsl:for-each select="witsml:axisDefinition"> |
---|
| 174 | <td><font size='-2'> |
---|
| 175 | <xsl:value-of select="witsml:doubleValues"/> |
---|
| 176 | </font></td> |
---|
| 177 | </xsl:for-each></tr> |
---|
| 178 | </table> |
---|
| 179 | |
---|
| 180 | </xsl:if> |
---|
| 181 | |
---|
| 182 | </td> |
---|
| 183 | </tr> |
---|
| 184 | </xsl:for-each> |
---|
| 185 | </table> |
---|
| 186 | </td> </tr> |
---|
| 187 | |
---|
| 188 | |
---|
| 189 | <!-- |
---|
| 190 | Output Log Pass, Block Info Data |
---|
| 191 | --> |
---|
| 192 | <tr><th colspan="11">Log Pass, Block Information</th> </tr> |
---|
| 193 | |
---|
| 194 | <tr><td colspan="11" align="center"> |
---|
| 195 | <xsl:for-each select="witsml:blockInfo"> |
---|
| 196 | <xsl:sort select="witsml:pass" data-type="number"/> |
---|
| 197 | <xsl:variable name='blockId'> |
---|
| 198 | <xsl:value-of select='@blockId'/> |
---|
| 199 | </xsl:variable> |
---|
| 200 | <xsl:variable name='startIndex'> |
---|
| 201 | <xsl:value-of select='witsml:startIndex'/> |
---|
| 202 | </xsl:variable> |
---|
| 203 | <xsl:variable name='increment'> |
---|
| 204 | <xsl:choose> |
---|
| 205 | <xsl:when test="witsml:direction='Decreasing'"> |
---|
| 206 | <xsl:value-of select='-1*witsml:stepIncrement'/> |
---|
| 207 | </xsl:when> |
---|
| 208 | <xsl:otherwise> |
---|
| 209 | <xsl:value-of select='witsml:stepIncrement'/> |
---|
| 210 | </xsl:otherwise> |
---|
| 211 | </xsl:choose> |
---|
| 212 | </xsl:variable> |
---|
| 213 | <table align="center"> |
---|
| 214 | <tr> |
---|
| 215 | <th>Logging Pass</th> |
---|
| 216 | <th>Data Block Id</th> |
---|
| 217 | <th>Index</th> |
---|
| 218 | <th>Start Index</th> |
---|
| 219 | <th>End Index</th> |
---|
| 220 | <th>Step Increment</th> |
---|
| 221 | <th>Units</th> |
---|
| 222 | <th>direction</th> |
---|
| 223 | <th>Null Value</th> |
---|
| 224 | <th>Description</th> |
---|
| 225 | </tr> |
---|
| 226 | <tr class="listtable"> |
---|
| 227 | <td align="center"><xsl:value-of select="witsml:pass"/> </td> |
---|
| 228 | <td align="center"><a name='blockInfo_{@blockId}'> |
---|
| 229 | <xsl:value-of select="@blockId"/> |
---|
| 230 | </a></td> |
---|
| 231 | <td align="center"><xsl:value-of select="witsml:indexType"/> </td> |
---|
| 232 | <td align="center"><xsl:value-of select="$startIndex"/> </td> |
---|
| 233 | <td align="center"><xsl:value-of select="witsml:endIndex"/> </td> |
---|
| 234 | <td align="center"><xsl:value-of select="witsml:stepIncrement"/> </td> |
---|
| 235 | <td align="center"><xsl:apply-templates select="witsml:indexUnits" mode="UnitRef"/> </td> |
---|
| 236 | <td align="center"><xsl:value-of select="witsml:direction"/> </td> |
---|
| 237 | <td align="center"><xsl:value-of select="witsml:nullValue"/></td> |
---|
| 238 | <td align="center"><xsl:value-of select="witsml:description"/></td> |
---|
| 239 | </tr> |
---|
| 240 | |
---|
| 241 | </table><table align="center"> |
---|
| 242 | <!-- |
---|
| 243 | Set up a sub-table to display the logData elements |
---|
| 244 | --> |
---|
| 245 | <tr><th colspan="100%">Log Pass Data</th> </tr> |
---|
| 246 | |
---|
| 247 | <tr> |
---|
| 248 | <xsl:for-each select="witsml:blockCurveInfo"> |
---|
| 249 | <xsl:sort select="witsml:columnIndex" data-type="number"/> |
---|
| 250 | <xsl:variable name='curveId'> |
---|
| 251 | <xsl:value-of select='witsml:curveId'/> |
---|
| 252 | </xsl:variable> |
---|
| 253 | <th align="center"> |
---|
| 254 | <xsl:value-of select="../../witsml:logCurveInfo[@curveId=$curveId]/witsml:mnemonic"/> |
---|
| 255 | </th> |
---|
| 256 | </xsl:for-each> |
---|
| 257 | </tr> |
---|
| 258 | |
---|
| 259 | <tr> |
---|
| 260 | <xsl:for-each select="witsml:blockCurveInfo"> |
---|
| 261 | <xsl:sort select="witsml:columnIndex" data-type="number"/> |
---|
| 262 | <xsl:variable name='curveId'> |
---|
| 263 | <xsl:value-of select='witsml:curveId'/> |
---|
| 264 | </xsl:variable> |
---|
| 265 | <th align="center"> |
---|
| 266 | <xsl:apply-templates select="../../witsml:logCurveInfo[@curveId=$curveId]/witsml:unit" mode="UnitRef"/> |
---|
| 267 | </th> |
---|
| 268 | </xsl:for-each> |
---|
| 269 | </tr> |
---|
| 270 | |
---|
| 271 | <tr> |
---|
| 272 | <xsl:for-each select="witsml:blockCurveInfo"> |
---|
| 273 | <xsl:sort select="witsml:columnIndex" data-type="number"/> |
---|
| 274 | <th align="center"> |
---|
| 275 | <xsl:value-of select="witsml:minIndex"/> - |
---|
| 276 | <xsl:value-of select="witsml:maxIndex"/> |
---|
| 277 | </th> |
---|
| 278 | </xsl:for-each> |
---|
| 279 | </tr> |
---|
| 280 | |
---|
| 281 | <!-- |
---|
| 282 | Print out the data rows in an HTML table |
---|
| 283 | --> |
---|
| 284 | <xsl:choose> |
---|
| 285 | <xsl:when test="../witsml:logData/witsml:data[@id]"> |
---|
| 286 | <xsl:for-each select="../witsml:logData/witsml:data[@id=$blockId]"> |
---|
| 287 | <tr class="listtable"> |
---|
| 288 | <xsl:call-template name="splitstring"> |
---|
| 289 | <xsl:with-param name="string" select="."/> |
---|
| 290 | <xsl:with-param name="pattern" select="','"/> |
---|
| 291 | </xsl:call-template> |
---|
| 292 | </tr> |
---|
| 293 | </xsl:for-each> |
---|
| 294 | </xsl:when> |
---|
| 295 | <xsl:otherwise> |
---|
| 296 | <xsl:for-each select="../witsml:logData/witsml:data"> |
---|
| 297 | <tr class="listtable"> |
---|
| 298 | <xsl:call-template name="splitstring"> |
---|
| 299 | <xsl:with-param name="string" select="."/> |
---|
| 300 | <xsl:with-param name="pattern" select="','"/> |
---|
| 301 | </xsl:call-template> |
---|
| 302 | </tr> |
---|
| 303 | </xsl:for-each> |
---|
| 304 | </xsl:otherwise> |
---|
| 305 | </xsl:choose> |
---|
| 306 | </table> |
---|
| 307 | </xsl:for-each> |
---|
| 308 | <br/> |
---|
| 309 | |
---|
| 310 | |
---|
| 311 | </td> |
---|
| 312 | </tr> |
---|
| 313 | </table> |
---|
| 314 | |
---|
| 315 | <br/> |
---|
| 316 | |
---|
| 317 | <xsl:for-each select="witsml:commonData"> |
---|
| 318 | <table align="center"> |
---|
| 319 | <tr><th colspan="6">Common Data</th> </tr> |
---|
| 320 | <tr> |
---|
| 321 | <td class="label">Source</td> |
---|
| 322 | <td class="dataval"><xsl:value-of select="witsml:commonData/witsml:nameSource"/> </td> |
---|
| 323 | <td> </td> |
---|
| 324 | <td class="label">State (Plan/Actual)</td> |
---|
| 325 | <td class="dataval"><xsl:value-of select="witsml:commonData/witsml:itemState"/> </td> |
---|
| 326 | <td> </td> |
---|
| 327 | </tr> |
---|
| 328 | <tr> |
---|
| 329 | <td class="label">Time Stamp</td> |
---|
| 330 | <td class="dataval"><font size="-1"> |
---|
| 331 | <xsl:call-template name="formatdate"> |
---|
| 332 | <xsl:with-param name="strDate" select="witsml:commonData/witsml:dTimStamp"/> |
---|
| 333 | </xsl:call-template> |
---|
| 334 | </font> </td> |
---|
| 335 | <td> </td> |
---|
| 336 | <td class="label">Creation Time</td> |
---|
| 337 | <td class="dataval"><font size="-1"> |
---|
| 338 | <xsl:call-template name="formatdate"> |
---|
| 339 | <xsl:with-param name="strDate" select="witsml:commonData/witsml:dTimCreation"/> |
---|
| 340 | </xsl:call-template> |
---|
| 341 | </font> </td> |
---|
| 342 | </tr> |
---|
| 343 | <tr> |
---|
| 344 | <td class="label">Last Changed At</td> |
---|
| 345 | <td class="dataval"><font size="-1"> |
---|
| 346 | <xsl:call-template name="formatdate"> |
---|
| 347 | <xsl:with-param name="strDate" select="witsml:commonData/witsml:dTimLastChange"/> |
---|
| 348 | </xsl:call-template> |
---|
| 349 | </font> </td> |
---|
| 350 | </tr> |
---|
| 351 | <tr> |
---|
| 352 | <th colspan="6">Comments</th> |
---|
| 353 | </tr> |
---|
| 354 | <tr> |
---|
| 355 | <td colspan="6"><xsl:value-of select="witsml:commonData/witsml:comments"/> </td> |
---|
| 356 | </tr> |
---|
| 357 | </table> |
---|
| 358 | </xsl:for-each> |
---|
| 359 | <!-- End of CommonData --> |
---|
| 360 | </xsl:for-each> |
---|
| 361 | <!-- End of foreach logs/log --> |
---|
| 362 | </body> |
---|
| 363 | </html> |
---|
| 364 | </xsl:template> |
---|
| 365 | |
---|
| 366 | |
---|
| 367 | <!-- |
---|
| 368 | Takes a w3C date in yyyy-mm-ddThh:mm:ss.nnn format and converts it to |
---|
| 369 | a string in the format dd mmm yyyy hh:mm:ss |
---|
| 370 | --> |
---|
| 371 | <xsl:template name="formatdate"> |
---|
| 372 | <xsl:param name="strDate"/> |
---|
| 373 | <xsl:if test="string-length($strDate) >= 10"> |
---|
| 374 | <xsl:value-of select="substring($strDate,9,2)"/> |
---|
| 375 | <xsl:text> </xsl:text> |
---|
| 376 | <xsl:choose> |
---|
| 377 | <xsl:when test="substring($strDate,6,2) = '01'"> |
---|
| 378 | <xsl:text>Jan</xsl:text> |
---|
| 379 | </xsl:when> |
---|
| 380 | <xsl:when test="substring($strDate,6,2) = '02'"> |
---|
| 381 | <xsl:text>Feb</xsl:text> |
---|
| 382 | </xsl:when> |
---|
| 383 | <xsl:when test="substring($strDate,6,2) = '03'"> |
---|
| 384 | <xsl:text>Mar</xsl:text> |
---|
| 385 | </xsl:when> |
---|
| 386 | <xsl:when test="substring($strDate,6,2) = '04'"> |
---|
| 387 | <xsl:text>Apr</xsl:text> |
---|
| 388 | </xsl:when> |
---|
| 389 | <xsl:when test="substring($strDate,6,2) = '05'"> |
---|
| 390 | <xsl:text>May</xsl:text> |
---|
| 391 | </xsl:when> |
---|
| 392 | <xsl:when test="substring($strDate,6,2) = '06'"> |
---|
| 393 | <xsl:text>Jun</xsl:text> |
---|
| 394 | </xsl:when> |
---|
| 395 | <xsl:when test="substring($strDate,6,2) = '07'"> |
---|
| 396 | <xsl:text>Jul</xsl:text> |
---|
| 397 | </xsl:when> |
---|
| 398 | <xsl:when test="substring($strDate,6,2) = '08'"> |
---|
| 399 | <xsl:text>Aug</xsl:text> |
---|
| 400 | </xsl:when> |
---|
| 401 | <xsl:when test="substring($strDate,6,2) = '09'"> |
---|
| 402 | <xsl:text>Sep</xsl:text> |
---|
| 403 | </xsl:when> |
---|
| 404 | <xsl:when test="substring($strDate,6,2) = '10'"> |
---|
| 405 | <xsl:text>Oct</xsl:text> |
---|
| 406 | </xsl:when> |
---|
| 407 | <xsl:when test="substring($strDate,6,2) = '11'"> |
---|
| 408 | <xsl:text>Nov</xsl:text> |
---|
| 409 | </xsl:when> |
---|
| 410 | <xsl:when test="substring($strDate,6,2) = '12'"> |
---|
| 411 | <xsl:text>Dec</xsl:text> |
---|
| 412 | </xsl:when> |
---|
| 413 | </xsl:choose> |
---|
| 414 | <xsl:text> </xsl:text> |
---|
| 415 | <xsl:value-of select="substring($strDate,1,4)"/> |
---|
| 416 | </xsl:if> |
---|
| 417 | <xsl:if test="string-length($strDate) >= 19"> |
---|
| 418 | <xsl:text> </xsl:text> |
---|
| 419 | <xsl:value-of select="substring($strDate,12,8)"/> |
---|
| 420 | </xsl:if> |
---|
| 421 | </xsl:template> |
---|
| 422 | |
---|
| 423 | <!-- |
---|
| 424 | Template to split a delimiter separated string into individual HTML table elements |
---|
| 425 | --> |
---|
| 426 | <xsl:template name="splitstring"> |
---|
| 427 | <xsl:param name="string" select="''"/> |
---|
| 428 | <xsl:param name="pattern" select="' '"/> |
---|
| 429 | <xsl:choose> |
---|
| 430 | <xsl:when test="not($string)"/> |
---|
| 431 | <xsl:when test="not($pattern)"> |
---|
| 432 | <xsl:call-template name="_split-characters"> |
---|
| 433 | <xsl:with-param name="string" select="$string"/> |
---|
| 434 | </xsl:call-template> |
---|
| 435 | </xsl:when> |
---|
| 436 | <xsl:otherwise> |
---|
| 437 | <xsl:call-template name="_split-pattern"> |
---|
| 438 | <xsl:with-param name="string" select="$string"/> |
---|
| 439 | <xsl:with-param name="pattern" select="$pattern"/> |
---|
| 440 | </xsl:call-template> |
---|
| 441 | </xsl:otherwise> |
---|
| 442 | </xsl:choose> |
---|
| 443 | </xsl:template> |
---|
| 444 | |
---|
| 445 | <xsl:template name="_split-characters"> |
---|
| 446 | <xsl:param name="string"/> |
---|
| 447 | <xsl:if test="$string"> |
---|
| 448 | <td> |
---|
| 449 | <xsl:variable name='value'> |
---|
| 450 | <xsl:value-of select="substring($string, 1, 1)"/> |
---|
| 451 | </xsl:variable> |
---|
| 452 | <xsl:value-of select="$value"/> |
---|
| 453 | </td> |
---|
| 454 | <xsl:call-template name="_split-characters"> |
---|
| 455 | <xsl:with-param name="string" select="substring($string, 2)"/> |
---|
| 456 | </xsl:call-template> |
---|
| 457 | </xsl:if> |
---|
| 458 | </xsl:template> |
---|
| 459 | <xsl:template name="_split-pattern"> |
---|
| 460 | <xsl:param name="string"/> |
---|
| 461 | <xsl:param name="pattern"/> |
---|
| 462 | <xsl:choose> |
---|
| 463 | <xsl:when test="contains($string, $pattern)"> |
---|
| 464 | <xsl:if test="not(starts-with($string, $pattern))"> |
---|
| 465 | <td align="center"> |
---|
| 466 | <xsl:value-of select="substring-before($string, $pattern)"/> |
---|
| 467 | </td> |
---|
| 468 | </xsl:if> |
---|
| 469 | <xsl:call-template name="_split-pattern"> |
---|
| 470 | <xsl:with-param name="string" select="substring-after($string, $pattern)"/> |
---|
| 471 | <xsl:with-param name="pattern" select="$pattern"/> |
---|
| 472 | </xsl:call-template> |
---|
| 473 | </xsl:when> |
---|
| 474 | <xsl:otherwise> |
---|
| 475 | <td align="center"> |
---|
| 476 | <xsl:value-of select="$string"/> |
---|
| 477 | </td> |
---|
| 478 | </xsl:otherwise> |
---|
| 479 | </xsl:choose> |
---|
| 480 | </xsl:template> |
---|
| 481 | |
---|
| 482 | <!-- RealTimeData linked to the enumValues file. --> |
---|
| 483 | <xsl:template match="*" mode="RealTimeData"> |
---|
| 484 | <a href="../ancillary/enumValues.xml#RealTimeData::{.}"> |
---|
| 485 | <xsl:value-of select="."/> |
---|
| 486 | </a> |
---|
| 487 | </xsl:template> |
---|
| 488 | |
---|
| 489 | <!-- Unit of Measure Element linked to the unit file. --> |
---|
| 490 | <xsl:template match="*" mode="UnitRef"> |
---|
| 491 | <xsl:call-template name="uomRefString"> |
---|
| 492 | <xsl:with-param name="string" select="."/> |
---|
| 493 | <xsl:with-param name="path" select="'../ancillary/witsmlUnitDict.html'"/> |
---|
| 494 | </xsl:call-template> |
---|
| 495 | </xsl:template> |
---|
| 496 | |
---|
| 497 | <!-- Uom attribute linked to the unit file. --> |
---|
| 498 | <xsl:template match="*" mode="UomRef"> |
---|
| 499 | <xsl:call-template name="uomRefString"> |
---|
| 500 | <xsl:with-param name="string" select="@uom"/> |
---|
| 501 | <xsl:with-param name="path" select="'../ancillary/witsmlUnitDict.html'"/> |
---|
| 502 | </xsl:call-template> |
---|
| 503 | </xsl:template> |
---|
| 504 | |
---|
| 505 | |
---|
| 506 | <!-- Measure value with a unit of measure linked to the unit file. --> |
---|
| 507 | <xsl:template match="*" mode="valueWithUomRef"> |
---|
| 508 | <xsl:value-of select="."/> |
---|
| 509 | <xsl:text> </xsl:text> |
---|
| 510 | <xsl:call-template name="uomRefString"> |
---|
| 511 | <xsl:with-param name="path" select="'../ancillary/witsmlUnitDict.html'"/> |
---|
| 512 | </xsl:call-template> |
---|
| 513 | <!-- In case this is a coordinate, check for datum. --> |
---|
| 514 | <xsl:if test="@datum"> |
---|
| 515 | <xsl:text> </xsl:text> |
---|
| 516 | (<xsl:value-of select="@datum"/>) |
---|
| 517 | </xsl:if> |
---|
| 518 | </xsl:template> |
---|
| 519 | |
---|
| 520 | |
---|
| 521 | <!-- Template to create a name anchor or to create an href to a uom in the WITSML unit file. --> |
---|
| 522 | <!-- Add an underscore in front of Uppercase characters in the string. --> |
---|
| 523 | <!-- Also substitute T (times) and P (per) for period (.) and slash (/). --> |
---|
| 524 | <xsl:template name="uomRefString"> |
---|
| 525 | <xsl:param name="string" select="@uom"/> <!-- The uom string. --> |
---|
| 526 | <xsl:param name="index" select="1"/> <!-- The start index in the string. --> |
---|
| 527 | <xsl:param name="mode" select="'href'"/> <!-- 'href' or 'name'. --> |
---|
| 528 | <xsl:param name="path" select="''"/> <!-- Path to the unit file. Only relevant to 'href'. --> |
---|
| 529 | <xsl:choose> |
---|
| 530 | <xsl:when test="not($string)"> |
---|
| 531 | <!-- For whatever reason, this value does not have a uom. --> |
---|
| 532 | <!-- It may be a unitless quantity or an indexed parameter with an optional uom. --> |
---|
| 533 | </xsl:when> |
---|
| 534 | <xsl:when test="$index > string-length($string)"> |
---|
| 535 | -------- This is a bad call ---------- |
---|
| 536 | string='<xsl:value-of select="$string"/>' |
---|
| 537 | index='<xsl:value-of select="$index"/>' |
---|
| 538 | mode='<xsl:value-of select="$mode"/>' |
---|
| 539 | path='<xsl:value-of select="$path"/>' |
---|
| 540 | </xsl:when> |
---|
| 541 | <xsl:otherwise> |
---|
| 542 | <xsl:call-template name="_nextChar"> |
---|
| 543 | <xsl:with-param name="string" select="$string"/> |
---|
| 544 | <xsl:with-param name="index" select="$index"/> |
---|
| 545 | <xsl:with-param name="mode" select="$mode"/> |
---|
| 546 | <xsl:with-param name="original" select="$string"/> |
---|
| 547 | <xsl:with-param name="path" select="$path"/> |
---|
| 548 | </xsl:call-template> |
---|
| 549 | </xsl:otherwise> |
---|
| 550 | </xsl:choose> |
---|
| 551 | </xsl:template> |
---|
| 552 | <!--Template to examine the next character for an upper case letter. --> |
---|
| 553 | <xsl:template name="_nextChar"> |
---|
| 554 | <xsl:param name="string"/> |
---|
| 555 | <xsl:param name="index"/> |
---|
| 556 | <xsl:param name="mode"/> |
---|
| 557 | <xsl:param name="original"/> |
---|
| 558 | <xsl:param name="path"/> |
---|
| 559 | <xsl:variable name="char"><xsl:value-of select="substring($string,$index,1)"/></xsl:variable> |
---|
| 560 | <xsl:variable name="len"><xsl:value-of select="string-length($string)"/></xsl:variable> |
---|
| 561 | <xsl:choose> |
---|
| 562 | <xsl:when test="not($string)"/> |
---|
| 563 | <xsl:when test="$index > $len"> |
---|
| 564 | <!-- We are finished --> |
---|
| 565 | <xsl:if test="$mode = 'href'"> |
---|
| 566 | <a href="{$path}#uom::{translate($string,'./','TP')}"><xsl:value-of select="$original"/></a> |
---|
| 567 | </xsl:if> |
---|
| 568 | <xsl:if test="$mode = 'name'"> |
---|
| 569 | <a name="uom::{translate($string,'./','TP')}"/> |
---|
| 570 | </xsl:if> |
---|
| 571 | </xsl:when> |
---|
| 572 | <xsl:when test="$char='A'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 573 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 574 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 575 | </xsl:call-template></xsl:when> |
---|
| 576 | <xsl:when test="$char='B'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 577 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 578 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 579 | </xsl:call-template></xsl:when> |
---|
| 580 | <xsl:when test="$char='C'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 581 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 582 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 583 | </xsl:call-template></xsl:when> |
---|
| 584 | <xsl:when test="$char='D'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 585 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 586 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 587 | </xsl:call-template></xsl:when> |
---|
| 588 | <xsl:when test="$char='E'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 589 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 590 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 591 | </xsl:call-template></xsl:when> |
---|
| 592 | <xsl:when test="$char='F'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 593 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 594 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 595 | </xsl:call-template></xsl:when> |
---|
| 596 | <xsl:when test="$char='G'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 597 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 598 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 599 | </xsl:call-template></xsl:when> |
---|
| 600 | <xsl:when test="$char='H'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 601 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 602 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 603 | </xsl:call-template></xsl:when> |
---|
| 604 | <xsl:when test="$char='I'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 605 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 606 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 607 | </xsl:call-template></xsl:when> |
---|
| 608 | <xsl:when test="$char='J'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 609 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 610 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 611 | </xsl:call-template></xsl:when> |
---|
| 612 | <xsl:when test="$char='K'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 613 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 614 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 615 | </xsl:call-template></xsl:when> |
---|
| 616 | <xsl:when test="$char='L'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 617 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 618 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 619 | </xsl:call-template></xsl:when> |
---|
| 620 | <xsl:when test="$char='M'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 621 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 622 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 623 | </xsl:call-template></xsl:when> |
---|
| 624 | <xsl:when test="$char='N'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 625 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 626 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 627 | </xsl:call-template></xsl:when> |
---|
| 628 | <xsl:when test="$char='O'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 629 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 630 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 631 | </xsl:call-template></xsl:when> |
---|
| 632 | <xsl:when test="$char='P'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 633 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 634 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 635 | </xsl:call-template></xsl:when> |
---|
| 636 | <xsl:when test="$char='Q'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 637 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 638 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 639 | </xsl:call-template></xsl:when> |
---|
| 640 | <xsl:when test="$char='R'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 641 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 642 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 643 | </xsl:call-template></xsl:when> |
---|
| 644 | <xsl:when test="$char='S'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 645 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 646 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 647 | </xsl:call-template></xsl:when> |
---|
| 648 | <xsl:when test="$char='T'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 649 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 650 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 651 | </xsl:call-template></xsl:when> |
---|
| 652 | <xsl:when test="$char='U'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 653 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 654 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 655 | </xsl:call-template></xsl:when> |
---|
| 656 | <xsl:when test="$char='V'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 657 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 658 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 659 | </xsl:call-template></xsl:when> |
---|
| 660 | <xsl:when test="$char='W'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 661 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 662 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 663 | </xsl:call-template></xsl:when> |
---|
| 664 | <xsl:when test="$char='X'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 665 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 666 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 667 | </xsl:call-template></xsl:when> |
---|
| 668 | <xsl:when test="$char='Y'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 669 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 670 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 671 | </xsl:call-template></xsl:when> |
---|
| 672 | <xsl:when test="$char='Z'"><xsl:call-template name="_insertChar"><xsl:with-param name="string" select="$string"/> |
---|
| 673 | <xsl:with-param name="index" select="$index"/><xsl:with-param name="mode" select="$mode"/> |
---|
| 674 | <xsl:with-param name="original" select="$original"/><xsl:with-param name="path" select="$path"/> |
---|
| 675 | </xsl:call-template></xsl:when> |
---|
| 676 | <xsl:otherwise> |
---|
| 677 | <xsl:call-template name="_nextChar"> |
---|
| 678 | <xsl:with-param name="string" select="$string"/> |
---|
| 679 | <xsl:with-param name="index" select="$index +1"/> |
---|
| 680 | <xsl:with-param name="mode" select="$mode"/> |
---|
| 681 | <xsl:with-param name="original" select="$original"/> |
---|
| 682 | <xsl:with-param name="path" select="$path"/> |
---|
| 683 | </xsl:call-template> |
---|
| 684 | </xsl:otherwise> |
---|
| 685 | </xsl:choose> |
---|
| 686 | </xsl:template> |
---|
| 687 | <!--Template to insert an underscore at the current index while calling _nextChar. --> |
---|
| 688 | <xsl:template name="_insertChar"> |
---|
| 689 | <xsl:param name="string"/> |
---|
| 690 | <xsl:param name="index"/> |
---|
| 691 | <xsl:param name="mode"/> |
---|
| 692 | <xsl:param name="original"/> |
---|
| 693 | <xsl:param name="path"/> |
---|
| 694 | <xsl:variable name="len"><xsl:value-of select="string-length($string)"/></xsl:variable> |
---|
| 695 | <xsl:call-template name="_nextChar"> |
---|
| 696 | <xsl:with-param name="string" select="concat(substring($string,1,$index - 1),'_',substring($string,$index,$len - $index +1))"/> |
---|
| 697 | <xsl:with-param name="index" select="$index +2"/> |
---|
| 698 | <xsl:with-param name="mode" select="$mode"/> |
---|
| 699 | <xsl:with-param name="original" select="$original"/> |
---|
| 700 | <xsl:with-param name="path" select="$path"/> |
---|
| 701 | </xsl:call-template> |
---|
| 702 | </xsl:template> |
---|
| 703 | |
---|
| 704 | </xsl:stylesheet> |
---|