Using template parameters as modifiers to xml pointers (xpaths)

santaslay

New Member
I have searched all morning and yesterday afternoon and still cannot find an solution to my problem. It would be wonderful if you would help.I am working on an xsl-fo file that will be translated to PDF format with apache fop. I am trying to use parameters to modify xpaths to my xml file. It is a much more complicated system than the example following, but I have simplified it to the root of the problem.Suppose my xml file looks like:\[code\]<sc931> <whyoming> <train> <miles>98</miles> <time>9888</time> </whyoming> <georgia> <train> <miles>98</miles> <time>9888</time> </georgia></sc931>\[/code\]What I am trying to do is use a template parameter to access these values like so:Declaration of parameter\[code\]<xsl:param name="state" select="whyoming"/>\[/code\]Call\[code\]<xsl:value-of select="concat(/sc931/, $state, /train/miles)"/>\[/code\]But this call does not work because the concat function returns a string rather than a pointer to the proper node. What is the correct way to use a template parameter to modify an address given to a value-of statement?
 
Back
Top