New to this type of XML page

M

mike.lussier

I have written some simple XSL pages to extract the data I need but
each device here has a total of 6 keys and within this 6 values a time
stamp and how long until the next data extraction ( 300 seconds ) 5
minutes.

The page starts off with WebBox
Then goes to MeanPublic
How can I extract the "<First> data from the 6 Keys for that device ?
My coding so far has only revealled the first key and nothing more.


Mikey

<?xml version="1.0" encoding="utf-8"?><!DOCTYPE WebBox []>
<?xml-stylesheet href="mean200.xsl" type="text/xsl" ?>
<WebBox xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="MEAN_200.xsd">
<Info>
<Created>2007-07-05T18:45:19</Created>
<Culture>en-US</Culture>
</Info>
<MeanPublic>
<Key>WR18UW4E:1564403641:Error</Key>
<First>0</First>
<Last>0</Last>
<Min>0</Min>
<Max>0</Max>
<Mean>0</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Error-Cnt</Key>
<First>214</First>
<Last>214</Last>
<Min>214</Min>
<Max>214</Max>
<Mean>214</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:E-Total</Key>
<First>6574.23704818048</First>
<Last>6574.24611484896</Last>
<Min>6574.23704818048</Min>
<Max>6574.24611484896</Max>
<Mean>6574.241075</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Fac</Key>
<First>59.98</First>
<Last>59.99</Last>
<Min>59.96</Min>
<Max>59.99</Max>
<Mean>59.976667</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:h-Total</Key>
<First>11505.821753799</First>
<Last>11505.90369825</Last>
<Min>11505.821753799</Min>
<Max>11505.90369825</Max>
<Mean>11505.863675</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Iac</Key>
<First>886</First>
<Last>1150</Last>
<Min>869</Min>
<Max>1150</Max>
<Mean>972.466667</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Ipv</Key>
<First>538</First>
<Last>657</Last>
<Min>524</Min>
<Max>657</Max>
<Mean>580.55</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Mode</Key>
<First>7</First>
<Last>7</Last>
<Min>7</Min>
<Max>7</Max>
<Mean>7</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
 
M

Martin Honnen

I have written some simple XSL pages to extract the data I need but
each device here has a total of 6 keys and within this 6 values a time
stamp and how long until the next data extraction ( 300 seconds ) 5
minutes.

The page starts off with WebBox
Then goes to MeanPublic
How can I extract the "<First> data from the 6 Keys for that device ?
My coding so far has only revealled the first key and nothing more.

It is not clear to me what you want to achieve. Do you want to simply
process all those MeanPublic elements and output the First values? Then
use a tempate for those elements e.g.
<xsl:template match="WebBox">
<table>
<thead>
<tr>
<th>Key</th>
<th>First</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="MeanPublic"/>
</tbody>
</table>
</xsl:template>
<xsl:template match="MeanPublic">
<tr>
<td><xsl:value-of select="Key"/></td>
<td><xsl:value-of select="First"/></td>
</tr>
</xsl:template>
 
M

mike.lussier

It is not clear to me what you want to achieve. Do you want to simply
process all those MeanPublic elements and output the First values? Then
use a tempate for those elements e.g.
<xsl:template match="WebBox">
<table>
<thead>
<tr>
<th>Key</th>
<th>First</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="MeanPublic"/>
</tbody>
</table>
</xsl:template>
<xsl:template match="MeanPublic">
<tr>
<td><xsl:value-of select="Key"/></td>
<td><xsl:value-of select="First"/></td>
</tr>
</xsl:template>

Martin,

I tried what you sent me and it is a very close replication to a
senario I tried. It gives me no outyput at all. here is the xml file I
am working with if this helps any. Yes, I am trying to extract all the
keys and all of the first lines of data from the file. Honestly I
think we are both in the right ball park its just missing something.


<?xml version="1.0" encoding="utf-8"?><!DOCTYPE WebBox []>
<?xml-stylesheet href="mean200.xsl" type="text/xsl" ?><WebBox
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="MEAN_200.xsd">
<Info>
<Created>2007-07-05T18:45:19</Created>
<Culture>en-US</Culture>
</Info>
<MeanPublic>
<Key>WR18UW4E:1564403641:Error</Key>
<First>0</First>
<Last>0</Last>
<Min>0</Min>
<Max>0</Max>
<Mean>0</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Error-Cnt</Key>
<First>214</First>
<Last>214</Last>
<Min>214</Min>
<Max>214</Max>
<Mean>214</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:E-Total</Key>
<First>6574.23704818048</First>
<Last>6574.24611484896</Last>
<Min>6574.23704818048</Min>
<Max>6574.24611484896</Max>
<Mean>6574.241075</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Fac</Key>
<First>59.98</First>
<Last>59.99</Last>
<Min>59.96</Min>
<Max>59.99</Max>
<Mean>59.976667</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:h-Total</Key>
<First>11505.821753799</First>
<Last>11505.90369825</Last>
<Min>11505.821753799</Min>
<Max>11505.90369825</Max>
<Mean>11505.863675</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Iac</Key>
<First>886</First>
<Last>1150</Last>
<Min>869</Min>
<Max>1150</Max>
<Mean>972.466667</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Ipv</Key>
<First>538</First>
<Last>657</Last>
<Min>524</Min>
<Max>657</Max>
<Mean>580.55</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Mode</Key>
<First>7</First>
<Last>7</Last>
<Min>7</Min>
<Max>7</Max>
<Mean>7</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:pac</Key>
<First>104</First>
<Last>135</Last>
<Min>102</Min>
<Max>135</Max>
<Mean>114.316667</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:power On</Key>
<First>1387</First>
<Last>1387</Last>
<Min>1387</Min>
<Max>1387</Max>
<Mean>1387</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Serial Number</Key>
<First>1564403641</First>
<Last>1564403641</Last>
<Min>1564403641</Min>
<Max>1564403641</Max>
<Mean>1564403641</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Vac</Key>
<First>118</First>
<Last>118</Last>
<Min>117</Min>
<Max>118</Max>
<Mean>117.983333</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Vpv</Key>
<First>224</First>
<Last>233</Last>
<Min>218</Min>
<Max>236</Max>
<Mean>225.966667</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Vpv-_PE</Key>
<First>1</First>
<Last>1</Last>
<Min>1</Min>
<Max>1</Max>
<Mean>1</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Vpv-Setpoint</Key>
<First>225</First>
<Last>234</Last>
<Min>219</Min>
<Max>236</Max>
<Mean>226.5</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR18UW4E:1564403641:Zac</Key>
<First>0</First>
<Last>0</Last>
<Min>0</Min>
<Max>0</Max>
<Mean>0</Mean>
<Base>60</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Error</Key>
<First>0</First>
<Last>0</Last>
<Min>0</Min>
<Max>0</Max>
<Mean>0</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Error-Cnt</Key>
<First>82</First>
<Last>82</Last>
<Min>82</Min>
<Max>82</Max>
<Mean>82</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:E-Total</Key>
<First>8276.32272193088</First>
<Last>8276.33658860032</Last>
<Min>8276.32272193088</Min>
<Max>8276.33658860032</Max>
<Mean>8276.330643</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Fac</Key>
<First>59.98</First>
<Last>59.98</Last>
<Min>59.96</Min>
<Max>59.99</Max>
<Mean>59.974098</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Fac-Srr</Key>
<First>59.98</First>
<Last>59.98</Last>
<Min>59.96</Min>
<Max>59.99</Max>
<Mean>59.974098</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:h-Total</Key>
<First>6825.3641571402</First>
<Last>6825.4486015914</Last>
<Min>6825.3641571402</Min>
<Max>6825.4486015914</Max>
<Mean>6825.407436</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Iac</Key>
<First>692</First>
<Last>848</Last>
<Min>648</Min>
<Max>848</Max>
<Mean>717.47541</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:I-dif</Key>
<First>97</First>
<Last>97</Last>
<Min>97</Min>
<Max>97</Max>
<Mean>97</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:I-dif-Srr</Key>
<First>78</First>
<Last>78</Last>
<Min>78</Min>
<Max>78</Max>
<Mean>78</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Ipv</Key>
<First>640</First>
<Last>801</Last>
<Min>612</Min>
<Max>801</Max>
<Mean>692.131148</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Max Temperature</Key>
<First>66.5</First>
<Last>66.5</Last>
<Min>66.5</Min>
<Max>66.5</Max>
<Mean>66.5</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Max Vpv</Key>
<First>515</First>
<Last>515</Last>
<Min>515</Min>
<Max>515</Max>
<Mean>515</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Mode</Key>
<First>7</First>
<Last>7</Last>
<Min>7</Min>
<Max>7</Max>
<Mean>7</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:pac</Key>
<First>166</First>
<Last>204</Last>
<Min>156</Min>
<Max>204</Max>
<Mean>172.327869</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:power On</Key>
<First>762</First>
<Last>762</Last>
<Min>762</Min>
<Max>762</Max>
<Mean>762</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Serial Number</Key>
<First>1374125280</First>
<Last>1374125280</Last>
<Min>1374125280</Min>
<Max>1374125280</Max>
<Mean>1374125280</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Temperature</Key>
<First>42.5</First>
<Last>41.4</Last>
<Min>41.4</Min>
<Max>42.5</Max>
<Mean>41.827869</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Vac</Key>
<First>241</First>
<Last>241</Last>
<Min>240</Min>
<Max>241</Max>
<Mean>240.754098</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Vac-Srr</Key>
<First>241</First>
<Last>241</Last>
<Min>240</Min>
<Max>241</Max>
<Mean>240.934426</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Vpv</Key>
<First>320</First>
<Last>301</Last>
<Min>287</Min>
<Max>320</Max>
<Mean>304.901639</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Vpv-_PE</Key>
<First>0</First>
<Last>0</Last>
<Min>0</Min>
<Max>0</Max>
<Mean>0</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Vpv-Setpoint</Key>
<First>321</First>
<Last>302</Last>
<Min>288</Min>
<Max>321</Max>
<Mean>305.52459</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>
<MeanPublic>
<Key>WR25UW8E:1374125280:Zac</Key>
<First>0</First>
<Last>0</Last>
<Min>0</Min>
<Max>0</Max>
<Mean>0</Mean>
<Base>61</Base>
<Period>300</Period>
<TimeStamp>2007-07-05T18:45:18</TimeStamp>
</MeanPublic>

</WebBox>
 
M

Martin Honnen

I tried what you sent me and it is a very close replication to a
senario I tried. It gives me no outyput at all. here is the xml file I
am working with if this helps any. Yes, I am trying to extract all the
keys and all of the first lines of data from the file. Honestly I
think we are both in the right ball park its just missing something.

Are you viewing the result in a browser? If you want HTML output and
want to output a complete HTML document then change the template for
WebBox to

<xsl:template match="WebBox">
<html lang="en">
<head>
<title>Keys</title>
</head>
<body>
<table>
<thead>
<tr>
<th>Key</th>
<th>First</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="MeanPublic"/>
</tbody>
</table>
</body>
</html>
</xsl:template>

Other than that I don't see anything missing, I have put up a small
example here:

<http://home.arcor.de/martin.honnen/xslt/test2007070802.xml>

works fine for me when loaded with IE or Mozilla.
 
M

mike.lussier

Got it thank you,
Now to start focusing in on the ones that I really need !

Thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,008
Messages
2,570,269
Members
46,871
Latest member
Stephendes

Latest Threads

Top