This variable, too, is declared at class level for the reason mentioned earlier.The flag Boolean variable is just used to detect whether a file is done with the validation or not.
Before the files are saved on the server you check whether the uploaded file(s) is a valid XML document.
You do this by validating the incoming file against an XML schema.
Now we want to ensure that the uploaded files are indeed match this structure.
This validation is done with the help of the following XML Schema : We won't go into the details of this schema.
Error, 1 Rosetta Code -w Validation warning: Could not find schema information for the element 'root'.]]
Validation error: The 'an-attribute' element is invalid - The value 'wrong' is invalid according to its datatype ' - The string 'wrong' is not a valid boolean value.The file field is rendered using the Text Box() helper.The type attribute is changed from the default of text to file and its multiple attribute is also set to allow multiple file selection. Below the submit button there is a foreach loop they outputs all the success or error messages. Now let's focus on the more important part - validating XML file against an XSD schema.This was a safeguard against manual or accidental tampering of the files that might take place at the end user's side.If a file is found to be invalid the it shouldn't be accepted in the system for obvious reason.XMLUnit provides you with the tools to verify the XML you emit is the one you want to create.