For an example of what I am trying to do, here is some sample code to give you a better idea...
Now if you run this code...
it will return these objects:
Is there a way to filter the results down to this...
I am trying to make a drop down list (ListUser), so that when you click on a User's name, I can display the 'Objects' they use in a second List (ListObjects)...
The VB code will probably look something like this...
...Unless anyone has a better idea ;-)
But I need to remove the duplicate names from the list...
My goal is for the User List to look like this:
Then when you click Josh1, the Object list will look like this:
I could do this by looping through and checking to see if I have already added the names to the list before adding another, but I was curious to see if there was a simpler method to speed things up a little ;-)
Thanks in Advance,
Josh
Have Fun, Be Young... Code BASIC
-Josh
PROGRAMMER:
Red-eyed, mumbling mammal capable of conversing with inanimate objects.
Code:
<OBJECTS>
<OBJECT>
<NAME>Object1</NAME>
<USER>[b]Josh1[/b]</USER>
</OBJECT>
<OBJECT>
<NAME>Object2</NAME>
<USER>[b]Josh2[/b]</USER>
</OBJECT>
<OBJECT>
<NAME>Object3</NAME>
<USER>[b]Josh1[/b]</USER>
<USER>[b]Josh2[/b]</USER>
</OBJECT>
<OBJECT>
<NAME>Object4</NAME>
<USER>[b]Josh1[/b]</USER>
<USER>[b]Josh3[/b]</USER>
<USER>[b]Josh4[/b]</USER>
</OBJECT>
</OBJECTS>
Now if you run this code...
Code:
xmlDOM.documentElement.getElementsByTagName("USER")
it will return these objects:
Code:
<USER>[b]Josh1[/b]</USER>
<USER>[b]Josh2[/b]</USER>
<USER>[b]Josh1[/b]</USER>
<USER>[b]Josh2[/b]</USER>
<USER>[b]Josh1[/b]</USER>
<USER>[b]Josh3[/b]</USER>
<USER>[b]Josh4[/b]</USER>
Is there a way to filter the results down to this...
Code:
<USER>[b]Josh1[/b]</USER>
<USER>[b]Josh2[/b]</USER>
<USER>[b]Josh3[/b]</USER>
<USER>[b]Josh4[/b]</USER>
I am trying to make a drop down list (ListUser), so that when you click on a User's name, I can display the 'Objects' they use in a second List (ListObjects)...
The VB code will probably look something like this...
Code:
Set Objs = xmlDOM.documentElement.getElementsByTagName("OBJECT")
ListObjects.Clear 'Clear the target list
For Each Obj in Objs
Set Users = Obj.getElementsByTagName("USER")
For Each User in Users
If User.Text = ListUser.Text Then
ListObjects.AddItem Obj.getElementsByTagName("NAME")(0).Text
Exit For
End If
Next
Next
...Unless anyone has a better idea ;-)
But I need to remove the duplicate names from the list...
My goal is for the User List to look like this:
Code:
Josh1
Josh2
Josh3
Josh4
Then when you click Josh1, the Object list will look like this:
Code:
Object1
Object3
Object4
I could do this by looping through and checking to see if I have already added the names to the list before adding another, but I was curious to see if there was a simpler method to speed things up a little ;-)
Thanks in Advance,
Josh
Have Fun, Be Young... Code BASIC
-Josh

PROGRAMMER: