Verify XML using XSD
Story
Your company get xml file outside (from partners) and process them using xslshowing
data on a web page. You don't want your page to be broken in case xml file is invalid. So you wrote an XSD file against which you verify xml files from partners
Task
- Use this xml file to build up an xsd file.
- Use an example code below to build up a PHP file that will verify xml against xsd. It should return a web page with error if xml files doesn't correspond to xsd, otherwise should return "xml is valid."
- Check your xsd with the sample xml above to ensure that your xsd is correct and php returns"xml is valid."
- Change xml file to be incorrect and ensure that your system is able to detect errors