Validate xml via terminal – Ubuntu

To validate xml via terminal

install xmlstarlet or xmlint

To install xmlstarlet,
http://installion.co.uk/ubuntu/vivid/universe/x/xmlstarlet/install/index.html
or
install via ubuntu software center

> apt-get install xmlstarlet

> xmlstarlet val "test.xml"

Output:

test.xml - valid

xmlint,
http://www.linuxask.com/questions/how-to-validate-the-format-of-a-xml-file-in-linux
http://stackoverflow.com/questions/4092812/tool-to-validate-an-xsd-on-ubuntu-linux

> xmllint --noout "file.xml"
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s