xsl-list
[Top] [All Lists]

Re: Basic help needed.

2003-10-30 02:06:07
I ;-think-; there is fundamental mistake in your
syntax..

Please replace some portions of your XSL, with --

<xsl:template match="PROJECT">
   <xsl:for-each select="EXPERIMENT">
      <xsl:call-template name="EXPERIMENT">
        <xsl:with-param name="my_pid"
select="parent::PROJECT/@PID"/>
      </xsl:call-template>
   </xsl:for-each>
</xsl:template>

<xsl:template name="EXPERIMENT">
  <xsl:param name="my_pid"/>
  <xsl:value-of select="$my_pid"/>;
</xsl:template>

Regards,
Mukul


--- kaseykim(_at_)socal(_dot_)rr(_dot_)com 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.

In other words, the template "experiment" does not
get the "my_pid" from the root body.

Kasey in LA.


-------------------------------------------------------

<?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>
 
</xsl:template>
 
 
 
<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>





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



__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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



<Prev in Thread] Current Thread [Next in Thread>