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

Re: Basic help needed.

Subject: Re: Basic help needed.
From: Richard Lewis <richard.lewis@xxxxxxxxx>
Date: Thu, 30 Oct 2003 09:30:30 +0000
arrtibute value xsl
On Thursday 30 Oct 2003 07:01, kaseykim@xxxxxxxxxxxx wrote:
> Guys
> I would really appreciate if you can help me, why, in the following XSL
> code, the paramter is not being passed from the parent node for the child
> node. I read through every tutorial and I could not yet figure out why it
> does not work.
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:template match="PROJECT">
> INSERT INTO PROJECT <xsl:value-of select="@PID"/>,
> <xsl:value-of select="TITLE"/>,
> <xsl:value-of select="START_DATE"/>,
> <xsl:value-of select="END_DATE"/>,
> <xsl:value-of select="CREATION_DATE"/>;
>
> <xsl:for-each select="EXPERIMENT">
> <xsl:apply-templates>
> <xsl:with-param name="my_pid" select="@PID" />
> </xsl:apply-templates>
> </xsl:for-each>

It looks to me as if the @PID arrtibute is an attribute of the PROJECT 
element, not the EXPERIMENT element.

But also, I don't think <xsl:for-each> is necessary here:

<xsl:apply-templates select="EXPERIMENT">
	<xsl:with-param name="my_pid" select="../@PID" />
</xsl:apply-templates>

(NOTE: '../' might not be neceassry here, I can never remember!)
>
> </xsl:template>
>
>

Also, I don't think its necessary to name this template; it can just match 
EXPERIMENT elemnts, can't it?

>
> <xsl:template name="experiment" match="EXPERIMENT">
> <xsl:param name="my_pid" />
> INSERT INTO EXPERIMENT <xsl:value-of select="@EXPID"/>,
> <xsl:value-of select="TITLE"/>,
> <xsl:value-of select="START_DATE"/>,
> <xsl:value-of select="END_DATE"/>,
> <xsl:value-of select="ORG_NAME"/>,
> <xsl:value-of select="ORG_ADDRESS"/>,
> <xsl:value-of select="LOCATION"/>,
> <xsl:value-of select="$my_pid"/>;
> </xsl:template>
>
> </xsl:stylesheet>
>

Cheers,
Richard


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


Current Thread
  • Basic help needed.
    • kaseykim - Thu, 30 Oct 2003 02:01:57 -0500 (EST)
      • Michael Kay - Thu, 30 Oct 2003 03:50:53 -0500 (EST)
      • Mukul Gandhi - Thu, 30 Oct 2003 04:06:16 -0500 (EST)
      • Richard Lewis - Thu, 30 Oct 2003 04:31:20 -0500 (EST) <=
      • <Possible follow-ups>
      • kaseykim - Thu, 30 Oct 2003 04:21:19 -0500 (EST)

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.