473,804 Members | 3,162 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:styleshe et 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="#eeeee e">
<th><font face="Tahoma" size="1">AUTHOR </font></th>
<th><font face="Tahoma" size="1">TITLE</font></th>
<th><font face="Tahoma" size="1">PUBLIS HER</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:v alue-of
select="@author "/></font></td>
<td><font face="Tahoma" size="2"><xsl:v alue-of
select="@name"/></font></td>
<td><font face="Tahoma" size="2">
<A>
<xsl:attribut e name="HREF"> http://www.someurlink.com </xsl:attribute>
<xsl:value-of select="@publis her"/>
</A>
</font></td>
</tr>
</xsl:template>
</xsl:stylesheet>
Jul 20 '05 #1
0 1243

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

Similar topics

1
1761
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 that contained within the page's text. I have done something like this for news articles but these are articles that are stored within a database so a simple SQL query would do. For this it would actually need to search the HTML page (ie.
3
4210
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 a few niggling problems and fixing it seems to be a case of patching errors as we find them so I'm thinking that it might be worth starting the logic from scratch and rebuilding this again. Basically we have a simple search, which is simply a...
4
1563
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 System in place, I have only limited control over the site - I can't even create a new page without asking the webhost to do it for me (for which there is an hourly charge). I have asked about changing to a CMS that will give me more control, but...
2
1808
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 FRO A SPECIFIC DATAVALUE AND INSERT IT IN A TEXTBOX IN THE ORIGINAL FORM. I WOULD LIKE TO CREATE A SIMILAR FACILITY IN ASP.NET I DON'T WANT A KEYPRESS FUNCTION I COULD CREATE A BUTTON ON THE SCREEN BUT I WANT TO CREATE A POPUP WINDOW WHERE I COULD...
2
1719
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 generated from database queries. Ideally I would like something that will search the pages generated by following links as that way it will index the whole site, not just the static bits. I looked through Google, but couldn't find a decent answer to...
3
2208
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 create this from a top bar menu option too...? Elaine
6
2642
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 the fields chosen. The first page, where they select the search fields and submit: <?php $db = mysql_connect("localhost", "root", "yeahright"); if (!$db) { die('Could not connect:'.mysql_error);
3
1368
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 107: protected string formatSalary(object Salary, object jobType) Line 108: { Line 109: int iSalary = Convert.ToInt32(Salary);
1
1409
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
9707
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.