Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Help Passing Param of string length and using it in a predicate He

From: "Joris Gillis" <joris.gillis@-------.--------.-->
To: 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)


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent