Is there any implicit method to use array to store the attribute values of a specified element?
My task is to check if there is a previous value exists such that there could be different expressions for them. For example, my xml is like this:
<p>
<c id=1>A</c>
<c id=2 ref=1>B</c>
<c id=3>C</c>
<c id=4>D</c>
<c id=5 ref=3>E</c>
</p>
-When looping through the element node c, firstly add the id value 1 into the array and display A with a specified color, say red.
-Then add the array by 2 and check that 1 is already in the array, so display B with the same color of A, i.e. red.
-Then add the array by 3 and display C with another color, say blue.
-Then add the array by 4 and display D with another color, say green.
-Then add the array by 5 and check that 3 is alreay in the array, so display E with the same color of C, i.e. blue.
The final output should be like this:
<font color="red">A<font>
<font color="red">B<font>
<font color="blue">C<font>
<font color="green">D<font>
<font color="blue">E<font>
Can I use xsl to do a such task? Thankyou very much.
My task is to check if there is a previous value exists such that there could be different expressions for them. For example, my xml is like this:
<p>
<c id=1>A</c>
<c id=2 ref=1>B</c>
<c id=3>C</c>
<c id=4>D</c>
<c id=5 ref=3>E</c>
</p>
-When looping through the element node c, firstly add the id value 1 into the array and display A with a specified color, say red.
-Then add the array by 2 and check that 1 is already in the array, so display B with the same color of A, i.e. red.
-Then add the array by 3 and display C with another color, say blue.
-Then add the array by 4 and display D with another color, say green.
-Then add the array by 5 and check that 3 is alreay in the array, so display E with the same color of C, i.e. blue.
The final output should be like this:
<font color="red">A<font>
<font color="red">B<font>
<font color="blue">C<font>
<font color="green">D<font>
<font color="blue">E<font>
Can I use xsl to do a such task? Thankyou very much.