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

[no subject]

[no subject]
<xsl:value-of select='concat("replace into table (index,variable) values
(&apos;",$index,"&apos;,&apos;",$variable,"&apos;)")' />

In there, you're telling it to concat (XSLT) variable $index, but in
other places you're outputting "$index" as text. (the first case) Is it
a PHP variable or an XSLT variable? Make up your mind, and amend your
stylesheet to follow suit.


Also, your code hurts my eyes. :P


~ Scott


-----Original Message-----
From: Joe Fawcett [mailto:joefawcett@xxxxxxxxxxx]
Sent: Thursday, September 27, 2007 2:36 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  XSL generating PHP/MySQL

Riku

Probably your variable is out of scope. Was it decalred in a different
template?

Joe

http://joe.fawcett.name


>From: Riku Riikonen <riku.riikonen@xxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject:  XSL generating PHP/MySQL
>Date: Thu, 27 Sep 2007 22:28:07 +0300
>
>Hello
>
>I'm pushing xml through xsl and trying to have php code.
>
>Can anyone help and tell me what i'm doing wrong in my xsl? (here comes

>just the problematic part)
>
>
>
><xsl:choose>
>	<xsl:when test="CASE1">
>
>		<xsl:text>
>		mysql_query("</xsl:text><xsl:value-of
select='concat("SET
>","@","index=LAST_INSERT_ID()")' /><xsl:text>");
>		$index="@index";</xsl:text>
>	</xsl:when>
>
>	<xsl:otherwise>
>		<xsl:choose>
>			<xsl:when test="CASE2">
>
<xsl:text>$index=&apos;20&apos;</xsl:text>
>			</xsl:when>
>			<xsl:otherwise>
>
<xsl:text>$index=&apos;0&apos;;</xsl:text>
>			</xsl:otherwise>
>		</xsl:choose>
>	</xsl:otherwise>
></xsl:choose>
><xsl:text>
></xsl:text>
>
><xsl:text>mysql_query("</xsl:text><xsl:value-of select='concat("replace

>into table (index,variable) values
>(&apos;",$index,"&apos;,&apos;",$variable,"&apos;)")'
>/><xsl:text>");</xsl:text>
>
>
>
>After XSLT process i is said that variable index has not been declared.

>Variable called variable has been declared elsewhere.
>
>I tried to use following
><xsl:variable name="index">$index</xsl:variable>
>, but it didn't work.
>
>Can anyone help me out?
>
>BR
>Riku

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.