This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FIRST-OCCURENCE


hi i have a prob

i have an xml file that looks like below

<colors>
   <colorids>
     	<color id = '1' type = 'pleasent'>
 		<text> maroon </text>
 	</color>
</colorids>
<colorids>
 	<color id = '2' type = 'rude'>
 		<text> red </text>
 	</color>
</colorids>
<colorids>
 	<color id = '3' type = 'pleasent'>
 		<text> blue </text>
 	</color>
</colorids>
<colorids>
 	<color id = '4' type = 'happy'>
 		<text> green </text>
 	</color>
</colorids>
<colorids>
 	<color id = '5' type = 'rude'>
 		<text> orange </text>
 	</color>
</colorids>
<colorids>
 	<color id = '6' type = 'rude'>
 		<text> bright yellow </text>
 	</color>
</colorids>


</colors>

i run a for-each for colors and want to attach ***** to the text 
of first occurence of the color with type = 'rude' and display the 
subsequent color text in a normal way
example,
i want the display of the above xml file to be like ..
*****red
orange
yellow


how do i do it.. I wanted to make use of the position() but 
position would only help me in getting the position of the 
nodes..
and i dont know which node has the required text. The only thing i 
know in the logic is , on the first occurence of a node, i need to 
append the *****

Can some one help me?

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]