I have a param named $SearchRecipe which holds a string that i'm always passing a lowercase string to.
I have an XML file which i'm accessing using my xslt and example of some data from the xml file :
<ARecipe>
<RecipeNo>117</RecipeNo>
<ItemName>Veggie Sausages with Beans and Chips</ItemName>
<RecipeInfo>
<Ingredients>Linda Mcartney Sausages(2 per serving), Beans (400g per serving), Chips(Handful), Random Chillis (up to you how much)</Ingredients>
<Instructions>Put on fat fryer, insert chips and sausages. Put on wok, insert beans and add some random chillis etc. Heat beans and remove cooked Sausages and Chips. Place sausages and chips in tissue to remove excess oil. Place in a plate and serve warm.</Instructions>
<RecipeType>Main</RecipeType>
<Vegetarian>No</Vegetarian>
</RecipeInfo>
</ARecipe>
I'm running a query to go through all the ItemName nodes and compare it to my string which works fine. For example if I put V in the string it matches the ItemName in this (ARecipe) and this gets displayed in my xslt output. However if I pass v as a value then it won't bring this particular node (ARecipe).
I'm using these lines to go through the xml file :
<xsl:variable name="matchedRecipes"
select="ARecipe[
($SearchType = 'Start' and starts-with($Test, $SearchRecipe)) or
($SearchType = 'Contains' and contains(ItemName, $SearchRecipe)) or
($SearchType = 'RecipeType' and
contains(RecipeInfo/RecipeType, $SearchRecipe))
]" />
<xsl:if test="$SearchType = 'Start' or $SearchType = 'Contains'">
<xsl:apply-templates select="$matchedRecipes">
What I have tried so far is this :
<xsl:variable name="Test">
<xsl:value-of select="translate('ARecipe/ItemName',$ucletters,$lcletters)"/>
</xsl:variable>
I'm a novice in most languages etc, but I would be able to do this kind of thing in C# fairly easily, i'm having an absolute nightmate with xslt. Also when I wrote this request for help, I had already been doing this work for a few hours and the last hour I've spent trying all sorts to get this lowercase issue to resolve. So if I've not asked properly, I would like to appologize in advance.
If you would like to see the larger picture I have uploaded my code here :