|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] JavaScript and XSL
Hello,
I am a newbie, so please excuse my ignorance. Yes, I have read lots and
lots. I am trying to create a searchable xml database. I have written an
XSL for a sample database that if you change what you are searching for in
the XSL itself, it searches and sorts the results. However, I need a form
(hopefully using JavaScript) that can take a user's input for what to search
for and drop it into the stylesheet. Is this possible? Or is there another
way to approach this? Any help would be greatly appreciated.
Sally Brown
Here is a sample record from the database.
<Deceased>
<Name>
<Honorific>Mr.</Honorific>
<F_Name>James</F_Name>
<Mid_Name>Melvin</Mid_Name>
<L_Name>Cooper</L_Name>
</Name>
<Obitdate>
<O_Month>May</O_Month>
<O_Day>22</O_Day>
<O_Year>2000</O_Year>
</Obitdate>
<Deathdate>
<D_Month>May</D_Month>
<D_Day>19</D_Day>
<D_Year>2000</D_Year>
</Deathdate>
<Graveplace>
<N_Cem>Crestlawn Memorial Park</N_Cem>
<C_Cem>Mableton,</C_Cem>
<S_Cem>Georgia</S_Cem>
</Graveplace>
</Deceased>
Here is the XSL. I am hoping to insert an L_Name into the stylesheet at the
for-each statement.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Cemetery Database</TITLE>
</HEAD>
<BODY>
<FONT FACE="Tahoma" color="indigo">
<H2>
<xsl:for-each order-by='+.//L_Name' select= ".//Name[L_Name='Cooper']"><br/>
Name: <xsl:value-of select="../Name" />
<br/>
Cemetery: <xsl:value-of select="..//Graveplace/N_Cem" />
<br/>
Date of death: <xsl:value-of select="../Deathdate" />
<br/>
Place of death: <xsl:value-of select="../Deathplace" />
<br/>
Obituary: <xsl:value-of select="../Obitdate" />
<br/>
</xsl:for-each>
</H2>
</FONT>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








