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

Problem: XSL with MSXML3.0SP1 and MS SQL Server2000

Subject: Problem: XSL with MSXML3.0SP1 and MS SQL Server2000
From: "Ruairi" <ruairi@xxxxxxxxxxxx>
Date: Wed, 15 Aug 2001 18:11:09 +0200
ms sql format number
Anyone using XSL with MSXML3.0 SP1 and MS SQL Server2000?  I have the
following problem:

The following XML and XSL work perfectly as standalone files.  When I use
SQL Server to dynamically create the XML it does perfectly.  Then when I
include the XSL attribute in the XML I get a internal server error no. 500.

Any suggestion are appreciated.

Original XML to SQL Server:
<?xml version="1.0"?>
<ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql" sql:xsl='login.xsl'>
  <sql:header>
     <sql:param name='user'>Dublin</sql:param>
     <sql:param name='pass'>adminpw</sql:param>
  </sql:header>
  <sql:query>
    <![CDATA[
       select * from Users
       where place = @user and password = @pass
       for xml auto
    ]]>
  </sql:query>
</ROOT>


Resulting XML from SQL Server (without XSL post-process):

<ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql">
  <Users place="Albany" name="Fruit from the Forest" groups="store"
password="adminpw" email="Albany@xxxxxxxxxxxx" account="500" currency="USD"
line="15 Main St" zip="12201" state="New York" country="US" />
  </ROOT>


XSL:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
   <xsl:output  method="html" media-type="text/html"  version="1.0"
standalone="yes"  indent="yes"/>
   <xsl:template match="/">

   	<html><body>
		   <xsl:choose>
		     <xsl:when test="ROOT/Users/@groups ='store'">
				<xsl:apply-templates select="/ROOT/Users" mode="login.store.success"/>

		     </xsl:when>
		     <xsl:when test="ROOT/Users/@groups = 'supplier'">
		     		<xsl:apply-templates select="/ROOT/Users"
mode="login.supplier.success"/>

		     </xsl:when>
		     <xsl:otherwise>
				<xsl:call-template name="login.fail"/>
		     </xsl:otherwise>
		   </xsl:choose>

   	</body></html>

   </xsl:template>
  <xsl:template name="login.fail">
	<form method="post" action="http://localhost/549/temp/ex71e.xml">
 		Name:<input type="text" name="user"/><br/>
		Password:<input type="text" name="pass"/><br/>
		<input type="submit" value="Login"/>
		<input type="hidden" name="xsl" value="login.xsl"/>
	</form>

   </xsl:template>

   <xsl:template  match="Users" mode="login.store.success">
		<p align="center">Hi <xsl:value-of select="@name"
disable-output-escaping="yes" />.
		Your Account is: <xsl:value-of select="format-number(@account,'#,##0.00')"
disable-output-escaping="yes" />
		(<xsl:value-of select="@currency" disable-output-escaping="yes" />).
		</p>


   </xsl:template>


   <xsl:template  match="Users" mode="login.supplier.success">
		<p align="center">Hi <xsl:value-of select="@place"
disable-output-escaping="yes" />.
   		Your Account is: <xsl:value-of
select="format-number(@account,'#,##0.00')" disable-output-escaping="yes" />
   		(<xsl:value-of select="@currency" disable-output-escaping="yes"
/>).<br/>
		</p>
   </xsl:template>


</xsl:stylesheet>

Regards,
-Ruairi


 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.