473,498 Members | 310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search Facility For XML File

I want to display results of a search in XML on a browser.
I have created a search form using HTML to accept parameters for the
field "author".
I want to be able to accept this parameter in the xsl and diplay all
results for this. Thanks for your help.

Please see sample XML

?xml version="1.0" encoding="ISO-8859-1" ?>
<live>
<llnode author="Lion" name="STEM" publisher="Dog" >

<llnode author="Cat" name="CANE" publisher="Hen" />

<llnode author="Dog" name="BRANCH" publisher="Ram" />

<llnode author="Cat" name="LEAF" publisher="Dog" />

<llnode author="Dog" name="PIPE" publisher="Dog" />

<llnode author="Lion" name="PANE" publisher="Hen" />

</llnode>
</live>

And a stylesheet to display in tabular form:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="live" />
</body>
</html>
</xsl:template>

<xsl:template match="live">
<table border="1" cellpadding="2" style="border-collapse:
collapse">
<tr bgcolor="#eeeeee">
<th><font face="Tahoma" size="1">AUTHOR</font></th>
<th><font face="Tahoma" size="1">TITLE</font></th>
<th><font face="Tahoma" size="1">PUBLISHER</font></th>

</tr>
<xsl:for-each select="llnode">
<xsl:apply-templates select="llnode" />
</xsl:for-each>

</table>
</xsl:template>

<xsl:template match="llnode">
<tr>
<td><font face="Tahoma" size="2"><xsl:value-of
select="@author"/></font></td>
<td><font face="Tahoma" size="2"><xsl:value-of
select="@name"/></font></td>
<td><font face="Tahoma" size="2">
<A>
<xsl:attribute name="HREF"> http://www.someurlink.com </xsl:attribute>
<xsl:value-of select="@publisher"/>
</A>
</font></td>
</tr>
</xsl:template>
</xsl:stylesheet>
Jul 20 '05 #1
0 1230

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

Similar topics

1
1747
by: bissatch | last post by:
Hi, I would like to add a search engine facility onto my website. This way, if anybody uses it to search my site they will be presented with a page of results where their search query matched...
3
4183
by: Alastair | last post by:
Hello guys, I've been building a search facility for an intranet site I'm part of developing and we've been building a search engine using Index Server. It mostly works, however there have been...
4
1543
by: Speaking Clock | last post by:
Hi, I have recently taken over the responsibility for a medium sized .org website that has been written entirely in .asp. Because there is a highly restrictive proprietary Content Management...
2
1780
by: GMK | last post by:
HI ALL I'M COMING FROM A FOX PRO BACKGROUND WHERE I COULD IN A VERY EASY WAY CREATE A SEACH FACILITY BY PRESSING N F1 AND ANOTHER WINDOW WILL DIRECTLY APPEAR WHICH WOULD LET THE USER TO SEARCH...
2
1704
by: Alan Silver | last post by:
Hello, I am in the planning stages of a new ASP.NET web site, and would like to know if it's possible to add a search facility to it. The site will be a mixture of static pages and ones...
3
2191
by: Elainie | last post by:
I would like to search a form with many fields on it, with out using the search facility through access. Througth a drop down list if possible.... How would I go about this? How could I also...
6
2617
by: jej1216 | last post by:
I am trying to put together a PHP search page in which the user can select none, one, two, or three fields to search, and then the results php will build the SQL with dynamic where caluses to reflect...
3
1356
by: tonydraper | last post by:
I have built a website and for some reason the search facility has stoppped working? When I carry out a job search the page that it redirects to comes up with this. Source Error: Line...
1
1396
by: VUNETdotUS | last post by:
In UNIX, one can use "grep" command to search for string occurrences within a file. How can I do this in Windows Server belonging to a third-party hosting facility? Thanks.
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7200
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
7375
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
5460
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,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.