~qbalazs/installation-guide/lp1030336

« back to all changes in this revision

Viewing changes to scripts/historic/validate.sh

  • Committer: joeyh
  • Date: 2005-10-07 19:51:38 UTC
  • Revision ID: vcs-imports@canonical.com-20051007195138-c3d57b2617a79a4f
move manual to top-level directory, split out of debian-installer package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
catalog=/usr/share/sgml/docbook/dtd/xml/4.2/catalog
 
4
xmldcl=/usr/share/sgml/declaration/xml.dcl
 
5
err=`tempfile`
 
6
 
 
7
if grep -q '^<!DOCTYPE' $1; then
 
8
  nsgmls -s -c $catalog $xmldcl $1 2> $err
 
9
else
 
10
  temp=`tempfile`
 
11
  topdir=`dirname $0`
 
12
  root=`sed -e '0,/<[a-z]/!d' $1 | sed -e '$!d' | sed -e 's/<\([a-z][a-zA-Z0-9]*\).*/\1/'`
 
13
  cat > $temp <<EOT
 
14
<!DOCTYPE $root PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "docbookx.dtd"   
 
15
[<!ENTITY % entities       SYSTEM "entities.ent"> %entities;]>
 
16
EOT
 
17
  cat $1 >> $temp
 
18
  nsgmls -s -D$topdir -c $catalog $xmldcl $temp 2> $err
 
19
  rm -f $temp
 
20
fi
 
21
 
 
22
less $err
 
 
b'\\ No newline at end of file'