bumble.sf.net language and parsing

plain text

The linux-xml Booklet

A booklet about using xml with linux. I will probably include some docbook information here as well.

* Simple XML tag extract with sed

 sed -n 's/.*<foo>\([^<]*\)<\/foo>.*/\1/p'

* Lists unambigously names of all xml elements used in files in

 grep -h -o '<[^/!?][^ >]*' * | sort -u | cut -c2-

* validate xml in a shell script.

 xmlproc_parse.python-xml &>/dev/null <FILE> || exit 1

* validate xml in a shell script using xmllint

 xmllint --noout some.xml 2>&1 >/dev/null || exit 1

* Adding formatting to an xml document for easier reading

 xmllint --format <filename> > <output file>