Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: 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 predicatTo: NULL Date: 6/2/2006 5:19:00 AM cheers quick and dirty worked like a dream I had assumed it was ByVal and not ByRef . lol This is extremely useful bit of knowledge and will save me countless headaches :). cheers Russ. "Joris Gillis" wrote: > 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="hea/Batch/Rec[not(listID = > preceding-sibling::Rec/listID)]"> > <!-- the context node is a 'Rec' element here--> > <xsl:call-template name="Batch"> > <xsl:with-param name="DataType" select="listID"/> > </xsl:call-template> > </xsl:for-each> > > > <xsl:template name="Batch"> > <!-- the context node is still a 'Rec' element here--> > > <xsl:for-each select="hea/Batch/Rec[sec='Daily' and listID = > $DataType]"> > </xsl:for-each> > > </xsl:template> > > So you're actually matching for 'hea/Batch/Rec/hea/Batch/Rec[sec='Daily' > and listID = $DataType]' > > A quick and dirty solution is to use '//hea/Batch/Rec[sec='Daily' and > listID = $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 | |||
|
