Subject:Help in For or while equivalent of XSLT Author:Surekha Palaparthy Date:19 Aug 2005 01:22 AM Originally Posted: 18 Aug 2005 05:54 AM
Can anyone help me in looping through a variable just for checking using XSLT?
I don't want to apply or call any templates.I want plane XSLT elements which can help me .Is there anything like <xsl:loop> or <xsl:loop-for > or <xsl:loop-while>???
I want something in XSLT which can be used exactly like this part of C code.
for(i=0;i<15;i++)
{
if( condition )
}
Subject:Help in For or while equivalent of XSLT Author:Tony Lavinio Date:22 Aug 2005 07:33 AM
XSLT is a declarative language; in part that means that variables
are immutable. You cannot change their value once set. Perhaps if
you explain what you are in terms of what the input and output are,
we can give you some pointers.
Subject:Help in For or while equivalent of XSLT Author:Surekha Palaparthy Date:22 Aug 2005 09:11 AM
My problem is something like this..
Let there be an array of Items.Items 1 to 10(Can be more,to consider only a loop).
Each item can be taken by a single person alone.But a person can take one or more items.Let there be 5 persons(Can be more , to take a loop ).
I am to loop through the data taken by each person.The XSLT has to check if the particular person number matches the value it has and give me the respective output placing a X mark saying that the particualr person has taken an item.This is a small scenario of a big XMl file that I am handling.I have made a part of XSLT and some modification is to be made in the XSLt so that my criterion can be met.
I have a call-template which calls the number of persons loop recurisvely.
I dont want to use any call-tempaltes or apply-templates as the code will become more complex.I just want to do that in a simple way where I can take up a loop.But incase if apply-templates or call-templates if the only way that I can deal with this,please let me know as to how I can go ahead ??
<xsl:template name="PersonDataBase">
<xsl:param name="PersonNo"/>
<xsl:if test="$PersonNo > 0" >
<ItemPresence>
<!---To write code here where he has to loop through the count of ItemNo and check for the 'present person number' if took an item.If yes he has to just put a 'X' in the output XML file
<ItemPresence>
</xsl:template>