How to Validate XML XSD

In this tutorial, we will guide you how to validate xml xsd. With xml validator, xsd files can be easily validated. Furthermore, you can check for errors that might occur during the valication process.

Step 1 – Open terminal

So let us get started with our “how to validate xml xsd” tutorial. First of all, click on the dash and open up the terminal application.

Open terminal application

Step 2 – View contents of home directory

With that done, type the command “ls” and hit the enter key. This will show you the contents of the Home directory. Over here you can see the test.xml file being displayed over here.

View contents

Step 3 – Validation command

Now type:
xmllint –schema schema.xsd test.xml. Hit the enter key when you are done.

Validate xml file

Step 4 – Validation successful

With that done you will see that your xml file has been validated without any errors.

XML successfully validated

Step 5 – Open xml in text editor

Now let’s go to the home directory and right click on the xml file. Over here, let’s open it with the Text Editor.

Use text editor to open xml file

Step 6 – Make changes to the xml file

Now let’s make some changes in the xml file over there. For example, you can add a single quote over there and then save the changes made.

Edit the xml file

Step 7 – Check error

Now let’s type the same command and use the same file which we edited earlier in the text editor.
You will notice that an error has occurred due to the changes that we made earlier. In this manner, you can use the xml validator for xsd files.

Error will be displayed