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

RE: XSQL & XSL - translation difficulties (newbie problem)

Subject: RE: XSQL & XSL - translation difficulties (newbie problem)
From: "Khaja, Saif" <Saif.Khaja@xxxxxxxxxxxxxxx>
Date: Wed, 19 Jul 2000 14:38:39 -0700
translation difficulties
Try this xsl!! Works for me...
And in case if u have more than one queries in your XSQL file, then better
set your rowset-element and row-element tags in your each query and
correspondingly apply templates for each such match.
I hope this method is fine as even I am a newbie. 

/* ************************** */
<?xml version="1.0" ?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>

  <xsl:template match="/">  
 <html>
    <head>
       <title>Query Results:</title>
    </head>
    <body>
       <table border="1" cellspacing="0">
          <tr>
             <th>Last Name</th>
             <th>First Name</th>
             <th>Security Clearance ID</th>
          </tr>

	<xsl:apply-templates/>

       </table>
    </body>
 </html>
  </xsl:template>  

  <xsl:template match="ROWSET/ROW">
             <tr>
                <td><xsl:value-of select="Last Name"/></td>
                <td><xsl:value-of select="First Name"/></td>
                <td><xsl:value-of select="Security Clearance ID"/></td>
             </tr>
  </xsl:template>

</xsl:stylesheet>

/* ************************** */

-----Original Message-----
From: Gary L Peskin [mailto:garyp@xxxxxxxxxxxx]
Sent: Wednesday, July 19, 2000 10:41 AM
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: Re: XSQL & XSL - translation difficulties (newbie problem)


Alex --

I just tried the XML (not the XSQL) and the stylesheet and the resulting
output works fine with Xalan.  If you're getting the table heading but
not the rows, there must be a problem with the select in the for-each. 
Can you verify that the XML results from the xsql file actually match
the XML that you think it does?

Gary

Alex Golden F-65 coop wrote:
> 
>    Hey all, I started working with XSQL & XSL a few days ago... I have
> successfully queried the database with XSQL, but I'm having problems
> using XSL to translate the results to HTML... In the HTML created using
> the XSL file the table row where the results should be is always
> blank.... I must be making a little mistake or typo, if someone could
> take a look at my code and give any suggestion I'd really appreciate it:
> 
> security_clearance.xsql:
> 
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="security_clearance.xsl"?>
>    <query connection = "caat">
>       SELECT last_name, first_name, security_clearance_id
>       from alex_security_clearances
>    </query>
> 
> security_clearance.xsl:
> 
> <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>    <head>
>       <title>Query Results:</title>
>    </head>
>    <body>
>       <table border="1" cellspacing="0">
>          <tr>
>             <th>Last Name</th>
>             <th>First Name</th>
>             <th>Security Clearance ID</th>
>          </tr>
>          <xsl:for-each select = "ROWSET/ROW">
>             <tr>
>                <td><xsl:value-of select="LAST_NAME"/></td>
>                <td><xsl:value-of select="FIRST_NAME"/></td>
>                <td><xsl:value-of select="SECURITY_CLEARANCE_ID"/></td>
>             </tr>
>          </xsl:for-each>
>       </table>
>    </body>
> </html>
> 
> ... The results when not translated look something like:
> <?xml version = '1.0'?>
> <ROWSET>
>    <ROW num="1">
>       <LAST_NAME>Doe</LAST_NAME>
>       <FIRST_NAME>Jane</FIRST_NAME>
>       <SECURITY_CLEARANCE_ID>12467</SECURITY_CLEARANCE_ID>
>    </ROW>
>    <ROW num="2">
>       <LAST_NAME>Doe</LAST_NAME>
>       <FIRST_NAME>John</FIRST_NAME>
>       <SECURITY_CLEARANCE_ID>68165</SECURITY_CLEARANCE_ID>
>    </ROW>
> </ROWSET>
> 
>    Thanks in advance!
> 
> -Alex


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


 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.