[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

sql, xml & forms

Subject: sql, xml & forms
From: "Kari M. Scott" <kmscott@xxxxxxxxxxxxxxxx>
Date: Tue, 7 Mar 2000 12:07:46 -0600 (CST)
form scott jdbc connection
Hello, 

I'm trying to pass the results of a sql query in an xml file to a variable
in my xsl stylesheet using the xsl:variable element and plugging the
variable into a form and I'm not having any luck discovering the correct
syntax. If someone has any simple examples of using xml with forms or
examples of the xsl:variable element they could send me, I'd really
appreciate it.  Or, here are my xml and xsl files; what am I doing wrong?  
Thanks in advance.

-Kari


_________form.xml______________
<?xml version="1.0" encoding="iso-8859-1"?>

<?cocoon-process type="sql"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="form.xsl" type="text/xsl"?>

<page>
<title>Passing Variables</title>
 <connectiondefs>
  <connection name="foo_connection">
   <driver>org.gjt.mm.mysql.Driver</driver>
   <dburl>jdbc:mysql://localhost/test</dburl>
  </connection>
 </connectiondefs>

 <query connection="foo_connection" doc-element="CATEGORY"
row-element="ROW">
        select child_name from cat_children
 </query>
</page>


---------form.xsl
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="page">
   <xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
   <html>
    <head>
     <title>
      <xsl:value-of select="title"/>
     </title>
    </head>
    <body bgcolor="#ffffff">
        <form action="results.xml" method="post">
          <BR>Please select a category:</BR>
          <xsl:apply-templates select="CATEGORY"/>
          <P><input type="submit" value="Submit"></P>
        </form>
    </body>
   </html>
  </xsl:template>

  <xsl:template match="CATEGORY">
    <xsl:apply-templates select="ROW">
    </xsl:apply-templates>
  </xsl:template>

  <xsl:template match="ROW">
    <xsl:variable name="category">
        <xsl:apply-templates/>
    </xsl:variable>
    <INPUT TYPE="RADIO" NAME="category" VALUE="{$category}"/>{$category}
  </xsl:template>

</xsl:stylesheet>



Kari M. Scott
Berbee
5520 Research Park Drive
Madison, WI  53711-5377
kmscott@xxxxxxxxxx
608.288.3000 ext. 1223
608.298.1223 direct dial
608.288.3037 fax

Berbee...putting the E in business





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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.