This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: JavaScript and XSL




-----Original Message-----
From: Sally Brown [mailto:lucy1@mindspring.com]
Sent: Sunday, October 15, 2000 11:25 PM
To: XSL-List@mulberrytech.com
Subject: 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


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]