RE: [xsl] xml/xslt 'merge' query

Subject: RE: [xsl] xml/xslt 'merge' query
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Wed, 26 May 2004 23:24:38 +0200
> -----Original Message-----
> From: Laurie Knight [mailto:arcn70@xxxxxxxxxxxxx]
>

Hi,

<snip what="source + target XML description" />
> <xsl:template name="lmk" match="/stockdate/lmk_stocklist/lmk_stock">

IIC, the problem is in your expectation that because a match pattern is
supplied, the template rule will match these nodes for you. Unfortunately,
this is *not* the case. It certainly isn't illegal to specify both match
pattern and name, but the effect of having both there simply means that the
template rule can be invoked through an xsl:call-template (name) as well as
through an xsl:apply-templates (match).

IIC, then it should be sufficient to change the following:

<xsl:call-template name="lmk">
  <xsl:with-param name="sqlstockcode" select="stockcode" />
</xsl:call-template>

to

<xsl:apply-templates select="/stockdate/lmk_stocklist/lmk_stock">
  <xsl:with-param name="sqlstockcode" select="stockcode" />
</xsl:apply-templates>

(for getting it to work, that is --getting it to work optimally would be a
different story, but since you seem keen on learning rather than having
someone else take away all your fun, I'll leave you to that... :) )

Your initial code just 'called the template', and so, prints out the value
of the param alright, but has no context node for which the subsequent test
can become true...


HTH!

Greetz,

Andreas

Current Thread