XML Parsing with classic asp

XML Parsing with classic asp

Closed - This job posting has been filled.

Job Description

I have 2 xml files.

xml1 is a list of employees on duty
xml2 is a list of all employees

I have a working classic asp script that parses the xml1 and pulls out the managers names and the hours they work...

Set xmlObj = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
xmlObj.async = False
xmlObj.setProperty "ServerHTTPRequest", True
xmlObj.Load("xml1")
If xmlObj.parseError.errorCode <> 0 Then
'### NOTHING
response.write "ERROR<br>"
End If
Set xmlList = xmlObj.getElementsByTagName("Shift")
Set xmlObj = Nothing
x = 1
For Each xmlItem In xmlList
EmployeeName = xmlItem.childNodes(1).text
Schedule = xmlItem.childNodes(2).text
StartTime = xmlItem.childNodes(3).text
EndTime = xmlItem.childNodes(4).text

If Trim(Schedule) = "Manager" Then
%>
<div class="item clearfix">
<div class="info">
<a href="#" class="name"><%=EmployeeName%></a>
<span><%=StartTime%> - <%=EndTime%></span>
<div class="controls">
<a href="#" class="icon-pencil"></a>
<a href="#" class="icon-envelope"></a>
<a href="#" class="icon-remove"></a>
</div>
</div>
</div>
<% End If %>

That part works great. What I need is to store those managers in an array. Then loop thru the array and go thru xml2 and get <Email> and <Cellphone> for each of the managers.

Should be a straight forward task for a seasoned XML writer. I will have a follow-up job after this regarding figuring out which of the managers for the day is actually on duty at any given time.

Please only apply if you have read and understand the task requirements. I need it done quickly and don't want to spend a lot of time discussing it. If you understand XML and classic ASP...it should be an easy task.


XML2 is attached. Here is XML1:

<?xml version="1.0" encoding="utf-8"?>
<Restaurant xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.schedulefly.com/api/">
<Name>The Lime</Name>
<Schedule>
<Day>
<Date>Saturday - 12/8/2012</Date>
<Shifts>
<Shift>
<EmployeeID>36261</EmployeeID>
<EmployeeName>Jordan Warshavsky</EmployeeName>
<Schedule>Manager</Schedule>
<StartTime>9:30AM</StartTime>
<EndTime>4:00PM</EndTime>
</Shift>
<Shift>
<EmployeeID>36273</EmployeeID>
<EmployeeName>James Trevino</EmployeeName>
<Schedule>Bar</Schedule>
<StartTime>3:00PM</StartTime>
<EndTime>1:00AM</EndTime>
<Note>WEEKEND SERVICE</Note>
</Shift>
<Shift>
<EmployeeID>84638</EmployeeID>
<EmployeeName>Sarah Monson</EmployeeName>
<Schedule>Bar</Schedule>
<StartTime>4:00PM</StartTime>
<EndTime>1:00AM</EndTime>
<Note>WEEKEND FRONT BAR</Note>
</Shift>
<Shift>
<EmployeeID>36280</EmployeeID>
<EmployeeName>Kevin Richardson</EmployeeName>
<Schedule>Manager</Schedule>
<StartTime>5:00PM</StartTime>
<EndTime>10:00PM</EndTime>
<Note>MANAGER 2</Note>
</Shift>
<Shift>
<EmployeeID>36281</EmployeeID>
<EmployeeName>Ben Archer</EmployeeName>
<Schedule>Manager</Schedule>
<StartTime>6:30PM</StartTime>
<EndTime>2:00AM</EndTime>
</Shift>
</Shifts>
</Day>
</Schedule>
</Restaurant>

---
Skills: asp-classic

Open Attachment