new XHTML validator shorthand
authorThorsten Glaser <tg@mirbsd.org>
Thu, 5 Jun 2014 19:26:21 +0000 (19:26 +0000)
committerThorsten Glaser <tg@mirbsd.org>
Thu, 5 Jun 2014 19:26:21 +0000 (19:26 +0000)
mksh/profile-funcs [new file with mode: 0644]

diff --git a/mksh/profile-funcs b/mksh/profile-funcs
new file mode 100644 (file)
index 0000000..b2f4588
--- /dev/null
@@ -0,0 +1,13 @@
+# XHTML validator
+xv() {
+       local i rv=0 s
+
+       for i in "$@"; do
+               s=$(sed \
+                   -e 's!http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd!file:///usr/src/www/mk/xhtml11.dtd!g' \
+                   <"$i" | xmlstarlet val -e -d file:///usr/src/www/mk/xhtml11.dtd -)
+               (( rv |= $? ))
+               print -r -- "$i $s"
+       done
+       return $rv
+}