SAX - missing element in XML document
Hello,
I have a question. Here is simple SAX Java example: http://www.roseindia.net/xml/sax/EmployeeDetails.shtml
The XML file contains Employees (with Emp_Id, Emp_Name and Emp_E-mail). I have situation when for example Emp_Name element is missing. Is it possible find out in Java console please?
I tried this:
Code:
if (name){
System.out.println("Name: " + str);
name = false;
}
else
{
System.out.println("Name is missing");
}
But this solution writes "Name is missing" every time. Thank you very much, best regards Tomas