Mister Zimbu
Member
I just can't wrap my head around a programming language that doesn't allow variables.
I have a tree like this:
I need to parse it and find the most commonly used value (in the tree segment above the XSL would print out "foo" for instance, because it appears twice).
I can't figure out how to do this without storing some sort of state. The only means of simulating a state I can find is recursion, which is out of the question in this situation, because there are many distinct values of Value in the full tree (400+).
Any suggestions?
I have a tree like this:
Code:
<a>
<b>
<c>
<value>blah</value>
<value>foo</value>
<value>bar</value>
<value>foo</value>
...
I need to parse it and find the most commonly used value (in the tree segment above the XSL would print out "foo" for instance, because it appears twice).
I can't figure out how to do this without storing some sort of state. The only means of simulating a state I can find is recursion, which is out of the question in this situation, because there are many distinct values of Value in the full tree (400+).
Any suggestions?