xsl-list
[Top] [All Lists]

RE: xml/xslt 'merge' query

2004-05-27 09:45:14
Hi Andreas,

Thats got the beastie of a problem, I knew it was something along those
lines although I suspected my IF TEST rather than the template itself..

I've now got an intermediate xml format as required and I've managed to
cut down on the lmk_stocks chunk to unique stocks, and I've got a second
xslt template to format up the output html table!

Many thanks for your pointer!
Best regards!

Laurie
--

-----Original Message-----
From: Laurie Knight [mailto:arcn70(_at_)dsl(_dot_)pipex(_dot_)com]


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


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



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