L
littlefitzer
Hi,
Say for example I want to use the following line in my XSL:
<xsl:call-template name="buildText"/>
I know I have to have a template defined named buildText.
My question is:
Is there a way to parse similarly named variables efficiently?
To elaborate, I had a template called buildText that would build some
text for me e.g.
<xsl:template name="buildText">
<lineOne>
<xsl:value-of select="$line"/>
parse some other stuff too.....
</lineOne>
....where line is defined as:
<xsl:variable name="line" select="'LINE'"/>
So that worked fine. Problem I now have is I have numerous lines I may
need to parse, and they are named LINE_1, LINE_2, LINE_3 etc. and also
maybe only LINE_1 and LINE_2 will be there and not LINE_3 and so on
Is there a way I can do this using the same template, possibly using a
variable?
i.e. call buildText_1 to parse LINE_1, buildText_2 to parse LINE_2,
but only have a single template defined called buildText?? where I can
replace the ?? with _1 or _2 etc as needed?
I hope this isn't too confusing. Thanks for any help,
Scott
Say for example I want to use the following line in my XSL:
<xsl:call-template name="buildText"/>
I know I have to have a template defined named buildText.
My question is:
Is there a way to parse similarly named variables efficiently?
To elaborate, I had a template called buildText that would build some
text for me e.g.
<xsl:template name="buildText">
<lineOne>
<xsl:value-of select="$line"/>
parse some other stuff too.....
</lineOne>
....where line is defined as:
<xsl:variable name="line" select="'LINE'"/>
So that worked fine. Problem I now have is I have numerous lines I may
need to parse, and they are named LINE_1, LINE_2, LINE_3 etc. and also
maybe only LINE_1 and LINE_2 will be there and not LINE_3 and so on
Is there a way I can do this using the same template, possibly using a
variable?
i.e. call buildText_1 to parse LINE_1, buildText_2 to parse LINE_2,
but only have a single template defined called buildText?? where I can
replace the ?? with _1 or _2 etc as needed?
I hope this isn't too confusing. Thanks for any help,
Scott