By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,494 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,494 IT Pros & Developers. It's quick & easy.

Search Facility For XML File

P: n/a
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" ?>
<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" />


And a stylesheet to display in tabular form:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
<xsl:template match="/">
<xsl:apply-templates select="live" />

<xsl:template match="live">
<table border="1" cellpadding="2" style="border-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>

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


<xsl:template match="llnode">
<td><font face="Tahoma" size="2"><xsl:value-of
<td><font face="Tahoma" size="2"><xsl:value-of
<td><font face="Tahoma" size="2">
<xsl:attribute name="HREF"> </xsl:attribute>
<xsl:value-of select="@publisher"/>
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.