cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1227
Views
0
Helpful
2
Replies

XML with the same path name

spbarr
Level 1
Level 1

Hello,

I am trying to use CCX to loop through an XML document with the same path name. The script should pull these values out of XML and into a string array. Below I have included the XML example and what I currently have from a code perspective. Help on this would be great!

<ColorTypes>

<type>RED</type>

<type>YELLOW</type>

<type>GREEN</type>

<type>BLUE</type>

</ColorTypes>

set colorcount = 0

Set color = new String [5]

color[colorcount] = get xml document

TAG LOOP

if color[colorcount] != "" then

increment colorcount

color[colorcount] = get xml document

(Removed error handling)

goto LOOP

The issue is only get the first "type" tag "RED" it never steps to the next type. Is there any way to have it capture all these values into an array?

Thank you!

2 Replies 2

Christian Holst
Level 1
Level 1

I'd put the colors into an array in the XML( ) and Then use tokenizer to work with the "array"

Sent from Cisco Technical Support iPad App

Thanks for the input, I think I found a way to do this with get xml document step VALUE(0)... VALUE(1) etc...