Size: 983
Comment:
|
← Revision 6 as of 2015-04-22 21:11:53 ⇥
Size: 1256
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 22: | Line 22: |
== Examples == Sample teste.xml XML with errors {{{ <teste> <a></a></a> </teste> </teste> }}} Command {{{ $ xml val -e -w teste.xml teste.xml:2.12: Opening and ending tag mismatch: teste line 1 and a <a></a></a> ^ teste.xml - invalid }}} |
XMLStarlet
XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.
http://xmlstar.sourceforge.net/overview.php
Windows: http://sourceforge.net/projects/xmlstar/files/xmlstarlet/1.6.1/xmlstarlet-1.6.1-win32.zip/download
Source code: http://sourceforge.net/p/xmlstar/code/ci/master/tree/
SlackBuild
SlackBuild: http://slackbuilds.org/repository/14.1/development/xmlstarlet/
- cd /tmp
wget http://slackbuilds.org/slackbuilds/14.1/development/xmlstarlet.tar.gz
- tar xvzf xmlstarlet.tar.gz
- cd xmlstarlet
wget http://downloads.sourceforge.net/xmlstar/xmlstarlet-1.6.1.tar.gz
./xmlstarlet.SlackBuild
- installpkg /tmp/xmlstarlet-1.6.1-i486-1_SBo.tgz
32 bit package: xmlstarlet-1.6.1-i486-1_SBo.tgz
Examples
Sample teste.xml XML with errors
<teste> <a></a></a> </teste> </teste>
Command
$ xml val -e -w teste.xml teste.xml:2.12: Opening and ending tag mismatch: teste line 1 and a <a></a></a> ^ teste.xml - invalid