×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

need help with Holiday script

Answered Question
Apr 23rd, 2014
User Badges:

Hi All,

 

I am not sure why my Holiday scripts keep returning Null, I have attached the script and xml files.

 

If someone can help would be great.

 

Thanks,

 

Hamed

Attachment: 
Correct Answer by Brian Meade about 3 years 4 months ago
So if you read through the logic of the script, it looks for Hokiday1 in the XML file theN Holiday2 then Holiday3, etc. As soon as it find one that doesn't exist is when the loop ends. If it doesn't find any, it returns null. Since your XML file starts with Holiday2, it returns null when looking for Holiday1 and then exits the script. I would try changing your XML file to begin with Holiday1 and aee what the debugging looks like after that.
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Brian Meade Wed, 04/23/2014 - 11:32
User Badges:
  • Silver, 250 points or more

One thing that is weird is your XML file starts with Holiday2 instead of Holiday1.  Have you tried debugging the script?

hamed1900 Wed, 04/23/2014 - 18:30
User Badges:

Hi Brian.

Thank you for your reply. I do not think it matters, when I debugged the script it returns Null for "Date" in Get XML file.

I can see it goes to the XML and pulls out the information, but I am not sure why it returns Null.

 

Thanks,

 

Hamed

 

Correct Answer
Brian Meade Wed, 04/23/2014 - 19:30
User Badges:
  • Silver, 250 points or more
So if you read through the logic of the script, it looks for Hokiday1 in the XML file theN Holiday2 then Holiday3, etc. As soon as it find one that doesn't exist is when the loop ends. If it doesn't find any, it returns null. Since your XML file starts with Holiday2, it returns null when looking for Holiday1 and then exits the script. I would try changing your XML file to begin with Holiday1 and aee what the debugging looks like after that.
hamed1900 Wed, 04/23/2014 - 20:36
User Badges:

My big five star to you mate,

It works now!!!!

Hamed

 

Actions

This Discussion