Yes, sorry about that. Let me explain more:
I am using XML to store a list of documents. Then I am using PHP to parse the list and convert it to HTML drop-down menus. To do this, I add the correct tags around each XML entry. Example, my XML looks like this:
Then I make it into this:
This is very basic XML but it works. Now what I would like to do is use a counter so that each time the <issue> tag is found, the counter increases. Why? Because then I can read from an array to give me a different coloured background for each option on the menu.
I am sure there are many other uses this idea will give me, but I cannot get it to work.
What I tried was increasing the counter every time the XML tag equals "<issue>" but that gave me the same counter every time. It just gave me "1". The counter never advanced. Is that because the XML is only really parsed once?
I also tried it if the data equals a number in the range I use. (Eg: <issue>23</issue> - data = "23".) But that was the same.
What I found odd also is that I am getting the counter displayed in other places on the page too, even though there is no <issue> tag there.
Please forgive me for my basic knowledge of XML and parsing. It's still a bit of a mystery to me, but I am slowly learning.