We have an XML file that we are trying to figure out how to use dynamically.
the basics are:
<part> <...> <fldMinPriceUSD>100.00</fldMinPriceUSD> <fldMaxPriceUSD>110.00</fldMaxPriceUSD> <fldMinPriceCAD>120.00</fldMinPriceCAD> <fldMaxPriceCAD>130.00</fldMaxPriceCAD> </part>
for each part that we have, we want to use xslt on it to capture the price of the part based on the currency sent through the parameter. We do not want to use if-elses, because we can increase the list of currencies (EUR, GBP, etc.) without changing our templates.
So, we would like to use the $dealerCurrency parameter (which would be USD, CAD, etc.) to match with fldMinPrice to capture this value. Is this even possible? I tried a few things, but no one works.
What I have tried so far:
<xsl:value-of select="format-number(str[@name=concat('fldMinPrice', $dealerCurrency)], '#.00')"/>
and this does not seem to work. Any suggestions?
source share