Tuesday, May 9, 2017

How to validate an xml document against a schema

STEP 1: Create the XML

To create a new XML file, start eclipse IDE and choose File->New->Other->XML file->Create XML file from XML template.
Model the data of interest in the XML file. In my case, I have created the following XML.

The teams.xml file

<?xml version="1.0" encoding="UTF-8"?>
 <name>the great team</name>
 <description>these team was recruited by google to develop a secret product</description>
  <developer role="frontend">
   <name>John Carrot</name>
  <developer role="backend">
   <name>Joshua Allock</name>
  <developer role="frontend">
   <name>Brendan Tich</name>