If date field is blank in XML file i am getting error.
see the below screenshot
I am using foreach loop, because i have multiple records in my xml file.
The code is working fine except the date error (if date is blank in xml element ==> Third Record "DateRelieved" is blank.
below sample xml data
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><RecSearch Val="175"><SearchRes>
<Employee EmpId="ME00001">
<EmpRetired>No</EmpRetired>
<CurrentStatus>true</CurrentStatus>
<DateRelieved>2018-08-20T23:00:00.000Z</DateRelieved>
</Employee>
<Employee EmpId="ME0002">
<EmpRetired></EmpRetired>
<CurrentStatus>true</CurrentStatus>
<DateRelieved>2018-08-20T10:00:00.000Z</DateRelieved>
</Employee>
<Employee EmpId="ME0003">
<EmpRetired></EmpRetired>
<CurrentStatus>true</CurrentStatus>
<DateRelieved></DateRelieved> =======> Date is blank.
</Employee>
</SearchRes>
</RecSearch>