473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

xslt - can you filter results

Can someone point me in the right direction regarding xml/xslt? I have
the following xml file with corresponding xslt and would like to add
some aditional functionality where a viewer can select from a dropdown
menu or radio box which tier of servers to view thereby filtering out
the others. From a few sources I've seen it looks like I would need to
use xsl:with-param, but references I've seen of this do not explain it
at my level (beginner).

Regards,

-Inet



--------------------XML FILE---------------------
<?xml version="1.0" encoding="ISO-8859-1"?><?xml-stylesheet
type="text/xsl" href="ndd_settings.xsl"?>
<servers>
<info><title>NDD Tcp Settings</title><date>Nov 14 2005 17:15:11
GMT</date></info>
<server hostname="server01" tier="dev" sysadmin="Goofy"><NddParameters>
<tcp_time_wait_interval default="240000" ewaa="60000"
sync="yes">60000</tcp_time_wait_interval>
<tcp_conn_req_max_q default="128" ewaa="1024"
sync="yes">1024</tcp_conn_req_max_q>
</NddParameters></server>
<server hostname="server02" tier="stg" sysadmin="Donald
Duck"><NddParameters>
<tcp_time_wait_interval default="240000" ewaa="60000"
sync="yes">60000</tcp_time_wait_interval>
<tcp_conn_req_max_q default="128" ewaa="1024"
sync="yes">1024</tcp_conn_req_max_q>
</NddParameters></server>
<server hostname="server03" tier="prd" sysadmin="Mickey
Mouse"><NddParameters>
<tcp_time_wait_interval default="240000" ewaa="60000"
sync="yes">60000</tcp_time_wait_interval>
<tcp_conn_req_max_q default="128" ewaa="1024"
sync="yes">1024</tcp_conn_req_max_q>
</NddParameters></server>

</servers>
---------------------XSLT FILE-------------------------

<?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="/servers">
<html>
<body>
<center><xsl:apply-templates select="info" /></center>
<center><table border="1"><caption><B>Legend</B></caption>
<tr><td>Solaris 8 Defaults</td></tr>
<tr><td bgcolor="#33FF66">EWAA Standard -
<xsl:value-of select="count(//@sync)"/> / <xsl:value-of
select="count(//NddParameters/*)"/> Completed</td></tr>
<tr><td bgcolor="red">Unknown Origin OR Old Standard</td></tr>
</table>
</center><br /><br />

<table border="1" width="100%">
<tr bgcolor="#CCCCCC">
<th>Server</th>
<th>Tier</th>
<th>SysAdmin</th>
<th STYLE="layout-flow: vertical-ideographic"
align="left">tcp_time_wait_interval</th>
<th STYLE="layout-flow: vertical-ideographic"
align="left">tcpconn_req_max_q</th>
</tr>

<xsl:apply-templates select="server" />

</table>
</body>
</html>
</xsl:template>

<xsl:template match="info">
<h2><xsl:value-of select="title"/></h2>
Generated: <xsl:value-of select="date"/>
</xsl:template>
<xsl:template match="server">
<tr>
<td><xsl:value-of select="@hostname"/></td>
<td><xsl:value-of select="@tier"/></td>
<td><xsl:value-of select="@sysadmin"/></td>
<xsl:choose>
<xsl:when test="NddParameters/tcp_time_wait_interval =
NddParameters/tcp_time_wait_interval/@ewaa">
<td bgcolor="#33FF66"><xsl:value-of
select="NddParameters/tcp_time_wait_interval"/></td>
</xsl:when>
<xsl:when test="NddParameters/tcp_time_wait_interval =
NddParameters/tcp_time_wait_interval/@default">
<td><xsl:value-of
select="NddParameters/tcp_time_wait_interval"/></td>
</xsl:when>
<xsl:otherwise>
<td bgcolor="red"><xsl:value-of
select="NddParameters/tcp_time_wait_interval"/></td>
</xsl:otherwise>
</xsl:choose>


<xsl:choose>
<xsl:when test="NddParameters/tcp_conn_req_max_q =
NddParameters/tcp_conn_req_max_q/@ewaa">
<td bgcolor="#33FF66"><xsl:value-of
select="NddParameters/tcp_conn_req_max_q"/></td>
</xsl:when>
<xsl:when test="NddParameters/tcp_conn_req_max_q =
NddParameters/tcp_conn_req_max_q/@default">
<td><xsl:value-of
select="NddParameters/tcp_conn_req_max_q"/></td>
</xsl:when>
<xsl:otherwise>
<td bgcolor="red"><xsl:value-of
select="NddParameters/tcp_conn_req_max_q"/></td>
</xsl:otherwise>
</xsl:choose>

</xsl:template>

</xsl:stylesheet>

Nov 23 '05 #1
0 1915

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ola Natvig | last post by:
Anybody out there who knows if the 4suite implementation of XSLT are a threadsafe one? -- -------------------------------------- Ola Natvig <ola.natvig@infosense.no> infoSense AS / development
6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
1
by: Philipp Schumann | last post by:
Hi, I'm using .NET Framework 1.1 XSLT. Can anyone tell me why this works: <xsl:for-each select="$somenodelist"> <xsl:if test="ext:CheckCondition (@condition)">Bla</xsl:if> </xsl:for-each>
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
2
by: Jeff Calico | last post by:
Hello everyone I have sucessfully implemented a SAX filter to take a large XML data file, and strip it down to its essential elements, and then pass that on to an XSL transformer. (A bare bones...
3
by: thomas.porschberg | last post by:
Hi, I want to read records from a database and export it in an arbitrary format. My idea was to feed a class with a String array fetched from the database and let this class fire SAX events as...
1
by: Nick | last post by:
I am working on a website for a client and one of their requirements was to have a mailing list. I decided to XSLT to transform "templates" to HTML so that editing was very easy and less time...
3
by: super.raddish | last post by:
Greetings, I am relatively new to, what I would call, advanced XSLT/XPath and I am after some advice from those in the know. I am attempting to figure out a mechanism within XSLT to compare the...
3
by: JamesDelaney | last post by:
Hello All, I'm new to XSLT and XML, so please excuse the basic question. I'm trying to apply a number of conditional xsl:if statements to xsl:for-each-group, but it does not filter out the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.