1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <xsl:stylesheet |
---|
3 | version="1.0" |
---|
4 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
5 | xmlns:witsml="http://www.witsml.org/schemas/131"> |
---|
6 | |
---|
7 | <!-- Author: John Shields, BHI, 2004 --> |
---|
8 | |
---|
9 | <xsl:include href="all_object_utility_templates.xsl"/> |
---|
10 | |
---|
11 | <xsl:output method="html"/> |
---|
12 | <xsl:template match="/"> |
---|
13 | <html> |
---|
14 | <head> |
---|
15 | <link rel='stylesheet' href='../stylesheets/witsml.css' type='text/css' /> |
---|
16 | </head> |
---|
17 | <body> |
---|
18 | <xsl:for-each select="witsml:logs/witsml:log"> |
---|
19 | <table align="center"> |
---|
20 | <tr > |
---|
21 | <th class='mainheader' colspan="6">WITSML Log</th> |
---|
22 | </tr> |
---|
23 | <tr> |
---|
24 | <td class='label'>Well Name:</td> |
---|
25 | <td class='dataval'><xsl:value-of select="witsml:nameWell"/></td> |
---|
26 | <td class='label'>Well Identifier</td> |
---|
27 | <td class='dataval'><xsl:value-of select="@uidWell"/></td> |
---|
28 | </tr> |
---|
29 | <tr> |
---|
30 | <td class='label'>Wellbore Name</td> |
---|
31 | <td class='dataval'><xsl:value-of select="witsml:nameWellbore"/></td> |
---|
32 | <td class='label'>Wellbore Identifier</td> |
---|
33 | <td class='dataval'><xsl:value-of select="@uidWellbore"/></td> |
---|
34 | </tr> |
---|
35 | <tr> |
---|
36 | <td class='label'>Log Name</td> |
---|
37 | <td class='dataval'><xsl:value-of select="witsml:name"/></td> |
---|
38 | <td class='label'>Log Identifier</td> |
---|
39 | <td class='dataval'><xsl:value-of select="@uid"/></td> |
---|
40 | </tr> |
---|
41 | |
---|
42 | |
---|
43 | <tr><th colspan='4'>Log Header</th></tr> |
---|
44 | <tr> |
---|
45 | <td class='label'>Service Company</td> |
---|
46 | <td class='dataval'><xsl:value-of select="witsml:serviceCompany"/></td> |
---|
47 | <td class='label'>Run Number</td> |
---|
48 | <td class='dataval'><xsl:value-of select="witsml:runNumber"/></td> |
---|
49 | </tr> |
---|
50 | <tr> |
---|
51 | <td class='label'>Description</td> |
---|
52 | <td class='dataval'><xsl:value-of select="witsml:description"/></td> |
---|
53 | <td class='label'>Creation Date</td> |
---|
54 | <td class='dataval'><font size='-1'> |
---|
55 | <xsl:call-template name="formatdate"> |
---|
56 | <xsl:with-param name="strDate" select="witsml:creationDate" /> |
---|
57 | </xsl:call-template></font></td> |
---|
58 | </tr> |
---|
59 | <tr> |
---|
60 | <td class='label'>Step Increment</td> |
---|
61 | <td class='dataval'><xsl:value-of select="witsml:stepIncrement"/> <xsl:apply-templates select="witsml:indexUnits" mode="UnitRef"/></td> |
---|
62 | <td class='label'>Index</td> |
---|
63 | <td class='dataval'><xsl:value-of select="witsml:indexType"/></td> |
---|
64 | <td> </td> |
---|
65 | </tr> |
---|
66 | <tr> |
---|
67 | <td class='label'>Index Curve: Mnemonic</td> |
---|
68 | <td class='dataval'><xsl:value-of select="witsml:indexCurve"/></td> |
---|
69 | <td class='label'>Index Curve: Column</td> |
---|
70 | <td class='dataval'><xsl:value-of select="witsml:indexCurve/@columnIndex"/></td> |
---|
71 | </tr> |
---|
72 | <tr> |
---|
73 | <td class='label'>Start Index</td> |
---|
74 | <td class='dataval'><xsl:apply-templates select="witsml:startIndex" mode="valueWithUomRef"/></td> |
---|
75 | <td class='label'>End Index</td> |
---|
76 | <td class='dataval'><xsl:apply-templates select="witsml:endIndex" mode="valueWithUomRef"/></td> |
---|
77 | </tr> |
---|
78 | <tr> |
---|
79 | <td class='label'>Direction</td> |
---|
80 | <td class='dataval'><xsl:value-of select="witsml:direction"/></td> |
---|
81 | <td class='label'>Null Value</td> |
---|
82 | <td class='dataval'><xsl:value-of select="witsml:nullValue"/></td> |
---|
83 | </tr> |
---|
84 | <!-- |
---|
85 | Output Log Header Parameters if there are any |
---|
86 | --> |
---|
87 | <xsl:choose> |
---|
88 | <xsl:when test="logParam"> |
---|
89 | <tr><th colspan='6'>Log Header Parameters</th></tr> |
---|
90 | <tr><td colspan='6' align='center'><table align='center'> |
---|
91 | <tr><th>Index</th><th>Name</th><th>Value</th><th>Units</th><th colspan='2'>Description</th></tr> |
---|
92 | <xsl:for-each select="witsml:logParam"> |
---|
93 | <tr class='listtable'> |
---|
94 | <td align='center'><xsl:value-of select="@index"/></td> |
---|
95 | <td align='center'><xsl:value-of select="@name"/></td> |
---|
96 | <td align='center'><xsl:value-of select="."/></td> |
---|
97 | <td align='center'><xsl:apply-templates select="." mode="UomRef"/></td> |
---|
98 | <td align='center'><xsl:value-of select="@description"/></td> |
---|
99 | </tr> |
---|
100 | </xsl:for-each> |
---|
101 | </table><br /></td></tr> |
---|
102 | </xsl:when> |
---|
103 | </xsl:choose> |
---|
104 | |
---|
105 | <!-- |
---|
106 | Output Log Curve Info Data |
---|
107 | --> |
---|
108 | <tr><th colspan='6'>Log Curve Information</th></tr> |
---|
109 | <tr><td colspan='6' align='center'> |
---|
110 | <table> |
---|
111 | <tr> <th>Index</th> |
---|
112 | <th>Mnemonic</th> |
---|
113 | <th>Class</th> |
---|
114 | <th>Units</th> |
---|
115 | <th>Alias</th> |
---|
116 | <th>Null Val</th> |
---|
117 | <th>Min</th> |
---|
118 | <th>Max</th> |
---|
119 | <th>State</th> |
---|
120 | <th>Type</th> |
---|
121 | <th>Offset</th> |
---|
122 | <th>Description</th></tr> |
---|
123 | <xsl:for-each select="witsml:logCurveInfo"> |
---|
124 | <xsl:sort select="witsml:columnIndex" data-type="number"/> |
---|
125 | <tr class='listtable'> |
---|
126 | <td align='center'><xsl:value-of select="witsml:columnIndex"/></td> |
---|
127 | <td align='center'><xsl:value-of select="witsml:mnemonic"/></td> |
---|
128 | <td align='center'><xsl:apply-templates select="witsml:classWitsml" mode="RealTimeData"/></td> |
---|
129 | <td align='center'><xsl:apply-templates select="witsml:unit" mode="UnitRef"/></td> |
---|
130 | <td align='center'><xsl:value-of select="witsml:mnemAlias"/></td> |
---|
131 | <td align='center'><xsl:value-of select="witsml:nullValue"/></td> |
---|
132 | <td align='center'><xsl:apply-templates select="witsml:minIndex" mode="valueWithUomRef"/></td> |
---|
133 | <td align='center'><xsl:apply-templates select="witsml:maxIndex" mode="valueWithUomRef"/></td> |
---|
134 | <td align='center'><xsl:value-of select="witsml:traceState"/></td> |
---|
135 | <td align='center'><xsl:value-of select="witsml:typeLogData"/></td> |
---|
136 | <td align='center'><xsl:apply-templates select="witsml:sensorOffset" mode="valueWithUomRef"/></td> |
---|
137 | <td align='center'><xsl:value-of select="witsml:curveDescription"/></td> |
---|
138 | </tr> |
---|
139 | </xsl:for-each> |
---|
140 | </table> |
---|
141 | |
---|
142 | </td></tr> |
---|
143 | </table> |
---|
144 | |
---|
145 | <br/> |
---|
146 | <!-- |
---|
147 | Set up a sub-table to display the logData elements |
---|
148 | --> |
---|
149 | <table> |
---|
150 | <tr><th colspan='100%'>Log Data</th></tr> |
---|
151 | <tr> |
---|
152 | <xsl:for-each select="witsml:logHeader/witsml:logCurveInfo"> |
---|
153 | <xsl:sort select="witsml:columnIndex" data-type="number"/> |
---|
154 | <th align='center'><xsl:value-of select="witsml:mnemonic" /></th> |
---|
155 | </xsl:for-each> |
---|
156 | </tr> |
---|
157 | <tr> |
---|
158 | <xsl:for-each select="witsml:logHeader/witsml:logCurveInfo"> |
---|
159 | <xsl:sort select="witsml:columnIndex" data-type="number"/> |
---|
160 | <th align='center'><xsl:apply-templates select="witsml:unit" mode="UnitRef"/></th> |
---|
161 | </xsl:for-each> |
---|
162 | </tr> |
---|
163 | |
---|
164 | <!-- |
---|
165 | Print out the data rows in an HTML table |
---|
166 | --> |
---|
167 | <xsl:for-each select="witsml:logData/witsml:data"> |
---|
168 | <tr class='listtable'> |
---|
169 | <xsl:call-template name="splitstring"> |
---|
170 | <xsl:with-param name="string" select="."/> |
---|
171 | <xsl:with-param name="pattern" select="','"/> |
---|
172 | </xsl:call-template> |
---|
173 | |
---|
174 | </tr> |
---|
175 | </xsl:for-each> |
---|
176 | </table> |
---|
177 | <br/> |
---|
178 | |
---|
179 | <table align="center"> |
---|
180 | <tr><th colspan='3'>Common Data</th></tr> |
---|
181 | <tr> |
---|
182 | <td class='label'>State (Plan/Actual)</td> |
---|
183 | <td class='dataval'><xsl:value-of select="witsml:commonData/witsml:itemState"/></td> |
---|
184 | <td> </td> |
---|
185 | </tr> |
---|
186 | <tr> |
---|
187 | <td class='label'>Creation Time</td> |
---|
188 | <td class='dataval'><font size='-1'> |
---|
189 | <xsl:call-template name="formatdate"> |
---|
190 | <xsl:with-param name="strDate" select="witsml:commonData/witsml:dTimCreation" /> |
---|
191 | </xsl:call-template> |
---|
192 | </font></td> |
---|
193 | </tr> |
---|
194 | <tr> |
---|
195 | <td class='label'>Last Changed At</td> |
---|
196 | <td class='dataval'><font size='-1'> |
---|
197 | <xsl:call-template name="formatdate"> |
---|
198 | <xsl:with-param name="strDate" select="witsml:commonData/witsml:dTimLastChange" /> |
---|
199 | </xsl:call-template> |
---|
200 | </font></td> |
---|
201 | </tr> |
---|
202 | <tr> |
---|
203 | <th colspan='6'>Comments</th> |
---|
204 | </tr><tr> |
---|
205 | <td colspan='6'><xsl:value-of select="witsml:commonData/witsml:comments"/></td> |
---|
206 | </tr> |
---|
207 | </table> <!-- End of CommonData --> |
---|
208 | </xsl:for-each> <!-- End of foreach logs/log --> |
---|
209 | </body> |
---|
210 | </html> |
---|
211 | </xsl:template> |
---|
212 | |
---|
213 | |
---|
214 | <!-- |
---|
215 | Takes a w3C date in yyyy-mm-ddThh:mm:ss.nnn format and converts it to |
---|
216 | a string in the format dd mmm yyyy hh:mm:ss |
---|
217 | --> |
---|
218 | <xsl:template name="formatdate"> |
---|
219 | <xsl:param name="strDate" /> |
---|
220 | <xsl:if test="string-length($strDate) >= 10"> |
---|
221 | <xsl:value-of select="substring($strDate,9,2)" /> |
---|
222 | <xsl:text> </xsl:text> |
---|
223 | <xsl:choose> |
---|
224 | <xsl:when test="substring($strDate,6,2) = '01'"> |
---|
225 | <xsl:text>Jan</xsl:text> |
---|
226 | </xsl:when> |
---|
227 | <xsl:when test="substring($strDate,6,2) = '02'"> |
---|
228 | <xsl:text>Feb</xsl:text> |
---|
229 | </xsl:when> |
---|
230 | <xsl:when test="substring($strDate,6,2) = '03'"> |
---|
231 | <xsl:text>Mar</xsl:text> |
---|
232 | </xsl:when> |
---|
233 | <xsl:when test="substring($strDate,6,2) = '04'"> |
---|
234 | <xsl:text>Apr</xsl:text> |
---|
235 | </xsl:when> |
---|
236 | <xsl:when test="substring($strDate,6,2) = '05'"> |
---|
237 | <xsl:text>May</xsl:text> |
---|
238 | </xsl:when> |
---|
239 | <xsl:when test="substring($strDate,6,2) = '06'"> |
---|
240 | <xsl:text>Jun</xsl:text> |
---|
241 | </xsl:when> |
---|
242 | <xsl:when test="substring($strDate,6,2) = '07'"> |
---|
243 | <xsl:text>Jul</xsl:text> |
---|
244 | </xsl:when> |
---|
245 | <xsl:when test="substring($strDate,6,2) = '08'"> |
---|
246 | <xsl:text>Aug</xsl:text> |
---|
247 | </xsl:when> |
---|
248 | <xsl:when test="substring($strDate,6,2) = '09'"> |
---|
249 | <xsl:text>Sep</xsl:text> |
---|
250 | </xsl:when> |
---|
251 | <xsl:when test="substring($strDate,6,2) = '10'"> |
---|
252 | <xsl:text>Oct</xsl:text> |
---|
253 | </xsl:when> |
---|
254 | <xsl:when test="substring($strDate,6,2) = '11'"> |
---|
255 | <xsl:text>Nov</xsl:text> |
---|
256 | </xsl:when> |
---|
257 | <xsl:when test="substring($strDate,6,2) = '12'"> |
---|
258 | <xsl:text>Dec</xsl:text> |
---|
259 | </xsl:when> |
---|
260 | </xsl:choose> |
---|
261 | <xsl:text> </xsl:text> |
---|
262 | <xsl:value-of select="substring($strDate,1,4)" /> |
---|
263 | </xsl:if> |
---|
264 | <xsl:if test="string-length($strDate) >= 19"> |
---|
265 | <xsl:text> </xsl:text> |
---|
266 | <xsl:value-of select="substring($strDate,12,8)" /> |
---|
267 | </xsl:if> |
---|
268 | </xsl:template> |
---|
269 | |
---|
270 | <!-- |
---|
271 | Template to split a delimiter separated string into individual HTML table elements |
---|
272 | --> |
---|
273 | <xsl:template name="splitstring"> |
---|
274 | <xsl:param name="string" select="''"/> |
---|
275 | <xsl:param name="pattern" select="' '"/> |
---|
276 | <xsl:choose> |
---|
277 | <xsl:when test="not($string)"/> |
---|
278 | <xsl:when test="not($pattern)"> |
---|
279 | <xsl:call-template name="_split-characters"> |
---|
280 | <xsl:with-param name="string" select="$string"/> |
---|
281 | </xsl:call-template> |
---|
282 | </xsl:when> |
---|
283 | <xsl:otherwise> |
---|
284 | <xsl:call-template name="_split-pattern"> |
---|
285 | <xsl:with-param name="string" select="$string"/> |
---|
286 | <xsl:with-param name="pattern" select="$pattern"/> |
---|
287 | </xsl:call-template> |
---|
288 | </xsl:otherwise> |
---|
289 | </xsl:choose> |
---|
290 | </xsl:template> |
---|
291 | <xsl:template name="_split-characters"> |
---|
292 | <xsl:param name="string"/> |
---|
293 | <xsl:if test="$string"> |
---|
294 | <td> |
---|
295 | <xsl:value-of select="substring($string, 1, 1)"/> |
---|
296 | </td> |
---|
297 | <xsl:call-template name="_split-characters"> |
---|
298 | <xsl:with-param name="string" select="substring($string, 2)"/> |
---|
299 | </xsl:call-template> |
---|
300 | </xsl:if> |
---|
301 | </xsl:template> |
---|
302 | <xsl:template name="_split-pattern"> |
---|
303 | <xsl:param name="string"/> |
---|
304 | <xsl:param name="pattern"/> |
---|
305 | <xsl:choose> |
---|
306 | <xsl:when test="contains($string, $pattern)"> |
---|
307 | <xsl:if test="not(starts-with($string, $pattern))"> |
---|
308 | <td align="center"> |
---|
309 | <xsl:value-of select="substring-before($string, $pattern)"/> |
---|
310 | </td> |
---|
311 | </xsl:if> |
---|
312 | <xsl:call-template name="_split-pattern"> |
---|
313 | <xsl:with-param name="string" select="substring-after($string, $pattern)"/> |
---|
314 | <xsl:with-param name="pattern" select="$pattern"/> |
---|
315 | </xsl:call-template> |
---|
316 | </xsl:when> |
---|
317 | <xsl:otherwise> |
---|
318 | <td align="center"> |
---|
319 | <xsl:value-of select="$string"/> |
---|
320 | </td> |
---|
321 | </xsl:otherwise> |
---|
322 | </xsl:choose> |
---|
323 | </xsl:template> |
---|
324 | |
---|
325 | |
---|
326 | <!-- RealTimeData linked to the enumValues file. --> |
---|
327 | <xsl:template match="*" mode="RealTimeData"> |
---|
328 | <a href="../ancillary/enumValues.xml#RealTimeData::{.}"> |
---|
329 | <xsl:value-of select="."/> |
---|
330 | </a> |
---|
331 | </xsl:template> |
---|
332 | |
---|
333 | </xsl:stylesheet> |
---|