IPCC CRS Editor - XML file traversal

Unanswered Question
Jul 11th, 2007

I?ve set up an xml file with the below format and I am trying to figure out how to

Traverse it so I can process each date. I?m not sure what the syntax is. I can get the first one with no

Problem. Any help is much appreciated.

<?xml version="1.0" encoding="utf-8" ?>

<!--

Holiday.xml

-->

<Holidays>

<Holiday>

<Name>New Year</Name>

<Date>01/01/2007</Date>

</Holiday>

<Holiday>

<Name>Memorial Day</Name>

<Date>05/31/2007</Date>

</Holiday>

<Holiday>

<Name>Fourth of July</Name>

<Date>07/04/2007</Date>

</Holiday>

<Holiday>

<Name>Labor Day</Name>

<Date>09/03/2007</Date>

</Holiday>

<Holiday>

<Name>Thanksgiving</Name>

<Date>11/22/2007</Date>

</Holiday>

<Holiday>

<Name>Thanksgiving Observance</Name>

<Date>11/23/2007</Date>

</Holiday>

<Holiday>

<Name>Christmas</Name>

<Date>12/31/2007</Date>

</Holiday>

</Holidays>

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.

I think Cisco publish a version of this. Perhaps the easiest thing is to search Cisco.com for it.

All you have to do is change the XML names to xx, xx etc. Then use a set step with the expression editor to return a new string like:

{

// increment

holidayEntryNum++;

String s = new String();

s = "Holiday" + holidayEntryNum;

return s;

}

then look for

"/descendant::Holidays/child::" + Holiday

with your Get XML Document step. And of course, loop until dates match.

Regards,

Geoff

joannemarie Thu, 07/12/2007 - 05:41

I have already redone it that way, and it works well. But, I would think there would be a way to interate through it when using instead of . I just do not know the syntax that Cisco expects and cannot find documentation on it.

Thanks for the response, I appreciate it.

Joanne

joluc_denmark Thu, 07/12/2007 - 05:45

You should't use that script/xml-file as it is ineffiecient.

Instead create the current date in your script (such as '25-12-07'and add the letter-prefix A or some other letter..) and then parse this xml-file instead:

0

XMAS07.WAV

It is more efficient (if if doesn't find anything, its not a holiday) and gives you a few more options (as illustrated).

rgds

johnny

Actions

This Discussion