Subject:Using Variables. How to use a flag to insert or not a label Author:Julio de la Vega Date:15 Oct 2007 10:34 AM Originally Posted: 15 Oct 2007 10:04 AM
Hi *,
I am trying to insert a specific label only once in my xml. Let me show you my scenario:
I have 3 types of nodes (node_1, node_2 and node_3). They can appear together or not but allways in the same order. Examples of the diferent secuences that can appear in my input data:
node_1, node_2 and node_3
node_1, node_2
node_1, node_3;
node_2 and node_3
node_1
node_2
node_3
I have to insert a tag but only in the first element of this secuence.
I thought to use a variable as a flag and "xsl:if" command to decide when to insert or not the tag but I can not use it because I can not update the variable with a new value as soon as I insert my first tag.
Could you please give me an overview about how I could manage this situation?
My initial idea and my actual development that do not work: