K
kmunderwood
How do I show only one Element with this code
Help Me, OH!!! Help Me
I have code that works, but...
This is the way it comes out in html
The Level, or Element "v1"(background) turns red when under 600
Bulk Storage Tanks
Tank<tag> Level<v1> Temperature<v4>
B05 535.91 22.22
B04 42567.36 22.81
B06 37265.17 21.94
B11 86.47 22.67
B01 395.47 69.65
B10 2.29 21.66
B07 32974.62 23.12
B03 13007.45 22.18
B02 23328.18 22.53
B12 71.17 21.57
B09 28961.24 22.34
B08 28045.13 21.52
P&F HM NAN none
_4..20mA-1 -0.01 none
_4..20mA-2 -0.01 none
_5V 4.92 none none
_boardtemp none 45.41
But, This is the way I want it
Tank Level Temperature
B01 395.47 69.65
(red bground)
Then, I can repeat the code in its own table, to show only the tanks
that I need.
(And in the order I want also)
Here is the abbreviated xml (I dont make the xml)
Full xml: http://home.earthlink.net/~kmunderwood/index.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<fieldgate ser="1B555D010A0" tag="TTL Bulk Storage Farm" type="full"
devices="all">
<os_version>3.18</os_version>
<conf>FXA520-AA1A</conf>
<device id="11183312ee" tag="B05" type="HART">
<v4>22.22</v4>
<tag>B05</tag>
<u1>lb</u1>
<v1>535.91</v1>
</device>
<device id="11183312e6" tag="B04" type="HART">
<v4>22.81</v4>
<tag>B04</tag>
<u1>lb</u1>
<v1>42567.36</v1>
</device>
<device id="11183309c5" tag="B01" type="HART">
<v4>69.65</v4>
<tag>B01</tag>
<u1>lb</u1>
<v1>395.47</v1>
</device>
<device id="_boardtemp" tag="_boardtemp" type="INTRN">
<tag>_boardtemp</tag>
<v1>45.41</v1>
<man>Endress+Hauser</man>
</device>
</fieldgate>
Here is the xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template
match="/">
<html>
<body>
<h2>Bulk Storage Tanks</h2>
<table border="1">
<tr bgcolor="green">
<th>Tank</th>
<th>Level</th>
<th>Temperature</th>
</tr>
<xsl:for-each select="fieldgate/device">
<tr>
<td><xsl:value-of select="@tag"/></td>
<xsl:choose>
<xsl:when test="v1 < 600">
<td bgcolor="red">
<xsl:value-of select="v1"/></td>
</xsl:when>
<xsltherwise>
<td><xsl:value-of select="v1"/></td>
</xsltherwise>
</xsl:choose>
<td><xsl:value-of select="v4"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template></xsl:stylesheet>
How do I tell it to show only B01, or B02, etc, plus its child Elements
that I choose?
Someone???An example??? Explainations might go over my head, but if
that is all you can give, Ill take it.
Thank you, Thank You, Thank You.
Ken
Help Me, OH!!! Help Me
I have code that works, but...
This is the way it comes out in html
The Level, or Element "v1"(background) turns red when under 600
Bulk Storage Tanks
Tank<tag> Level<v1> Temperature<v4>
B05 535.91 22.22
B04 42567.36 22.81
B06 37265.17 21.94
B11 86.47 22.67
B01 395.47 69.65
B10 2.29 21.66
B07 32974.62 23.12
B03 13007.45 22.18
B02 23328.18 22.53
B12 71.17 21.57
B09 28961.24 22.34
B08 28045.13 21.52
P&F HM NAN none
_4..20mA-1 -0.01 none
_4..20mA-2 -0.01 none
_5V 4.92 none none
_boardtemp none 45.41
But, This is the way I want it
Tank Level Temperature
B01 395.47 69.65
(red bground)
Then, I can repeat the code in its own table, to show only the tanks
that I need.
(And in the order I want also)
Here is the abbreviated xml (I dont make the xml)
Full xml: http://home.earthlink.net/~kmunderwood/index.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<fieldgate ser="1B555D010A0" tag="TTL Bulk Storage Farm" type="full"
devices="all">
<os_version>3.18</os_version>
<conf>FXA520-AA1A</conf>
<device id="11183312ee" tag="B05" type="HART">
<v4>22.22</v4>
<tag>B05</tag>
<u1>lb</u1>
<v1>535.91</v1>
</device>
<device id="11183312e6" tag="B04" type="HART">
<v4>22.81</v4>
<tag>B04</tag>
<u1>lb</u1>
<v1>42567.36</v1>
</device>
<device id="11183309c5" tag="B01" type="HART">
<v4>69.65</v4>
<tag>B01</tag>
<u1>lb</u1>
<v1>395.47</v1>
</device>
<device id="_boardtemp" tag="_boardtemp" type="INTRN">
<tag>_boardtemp</tag>
<v1>45.41</v1>
<man>Endress+Hauser</man>
</device>
</fieldgate>
Here is the xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template
match="/">
<html>
<body>
<h2>Bulk Storage Tanks</h2>
<table border="1">
<tr bgcolor="green">
<th>Tank</th>
<th>Level</th>
<th>Temperature</th>
</tr>
<xsl:for-each select="fieldgate/device">
<tr>
<td><xsl:value-of select="@tag"/></td>
<xsl:choose>
<xsl:when test="v1 < 600">
<td bgcolor="red">
<xsl:value-of select="v1"/></td>
</xsl:when>
<xsltherwise>
<td><xsl:value-of select="v1"/></td>
</xsltherwise>
</xsl:choose>
<td><xsl:value-of select="v4"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template></xsl:stylesheet>
How do I tell it to show only B01, or B02, etc, plus its child Elements
that I choose?
Someone???An example??? Explainations might go over my head, but if
that is all you can give, Ill take it.
Thank you, Thank You, Thank You.
Ken