summaryrefslogtreecommitdiffstats
path: root/bin/doctype
blob: a10441f9b6da7737bf2e62146a2a0405b44f1e27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
########################################################################
# Script to print the document type, without needing the XML document
# to validate.  Get the document type from the first argument to the
# <!DOCTYPE> element, which should be either "book" or "article".
#
# Use it like this:
# doctype file.xml
#
# If you know the XML file WILL VALIDATE, you may use the "doctype.xsl"
# script instead.  If not, use this one
########################################################################
egrep '^[[:space:]]*<!DOCTYPE' $*					|
awk '{print $2 "info"}'