Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Help Passing Param of string length and using it in a predicate He >Thread Next - Re: Help Passing Param of string length and using it in a predicat Re: Help Passing Param of string length and using it in a predicate HeTo: NULL Date: 6/2/2006 12:50:00 PM
On Fri, 02 Jun 2006 11:50:02 +0200, Russ <Russ@d...=
> =
wrote:
> Ok My problem is I am passing a param that is equal to the value of an=
> element ie CAP1.
In fact you're passing a node as a parameter. But anyway, I don't think =
it =
matters.
The problem is the context node. Each xpath expression is evaluated with=
=
respect to a context node.
<xsl:for-each select=3D"hea/Batch/Rec[not(listID =3D =
preceding-sibling::Rec/listID)]">
<!-- the context node is a 'Rec' element here-->
<xsl:call-template name=3D"Batch">
<xsl:with-param name=3D"DataType" select=3D"listID"/>
</xsl:call-template>
</xsl:for-each>
<xsl:template name=3D"Batch">
<!-- the context node is still a 'Rec' element here-->
<xsl:for-each select=3D"hea/Batch/Rec[sec=3D'Daily' and listID =3D
$DataType]">
</xsl:for-each>
</xsl:template>
So you're actually matching for 'hea/Batch/Rec/hea/Batch/Rec[sec=3D'Dail=
y' =
and listID =3D $DataType]'
A quick and dirty solution is to use '//hea/Batch/Rec[sec=3D'Daily' and =
=
listID =3D $DataType]'.
Better is to use keys...
regards,
-- =
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Veni, vidi, wiki (http://www.wikipedia.org)
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
