"Fossies" - the Fresh Open Source Software Archive

Member "OpenSP-1.5.2/tests/af-4" (14 May 2005, 1977 Bytes) of package /linux/misc/old/OpenSP-1.5.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 # Architectural Form: test ArcNamrA:
    3 #    change attribute name "n" to "v"
    4 # test onsgmls and osgmlnorm
    5 
    6 LANG=C; export LANG
    7 LC_ALL=C; export LC_ALL
    8 
    9 tmpfiles=""
   10 trap 'rm -fr $tmpfiles' 1 2 3 15
   11 
   12 tmpfiles="$tmpfiles af-4.sgml af-4.dtd af-meta-4.dtd"
   13 cat <<EOF >af-4.sgml
   14 <!DOCTYPE doc SYSTEM "af-4.dtd">
   15 <doc>
   16  <s>
   17   <v n="1">verse 1</v>
   18   <v n="2">verse 2</v>
   19  </s>
   20 </doc>
   21 EOF
   22 cat <<EOF >af-4.dtd
   23 <!NOTATION SGML PUBLIC "-//ISO 8879:1986//NOTATION Standard Generalized Markup
   24     Language//EN">
   25 
   26 <?IS10744 ArcBase open>
   27 <!NOTATION open PUBLIC "-//OpenJade Project//NOTATION AFDR ARCBASE open Architecture//EN">
   28 <!ATTLIST #NOTATION open
   29     ArcNamrA NAME #FIXED "doc-attr"
   30     ArcDTD CDATA #FIXED "opendtd">
   31 <!ENTITY opendtd SYSTEM "af-meta-4.dtd" CDATA SGML>
   32 
   33 <!ELEMENT doc - o (s+)>
   34 <!ATTLIST doc
   35   open NMTOKEN #FIXED "open">
   36 <!ELEMENT s   - o (v+)>
   37 <!ATTLIST s
   38   open NMTOKEN #FIXED "stanza">
   39 <!ELEMENT v   - o (#PCDATA)>
   40 <!ATTLIST v
   41   n CDATA #REQUIRED
   42   doc-attr CDATA #FIXED "v n"
   43   open NMTOKEN #FIXED "verse">
   44 EOF
   45 
   46 cat <<EOF >af-meta-4.dtd
   47 <!ELEMENT open     - o (stanza+)>
   48 <!ELEMENT stanza   - o (verse+)>
   49 <!ELEMENT verse    - o (#PCDATA)>
   50 <!ATTLIST verse
   51   v CDATA #REQUIRED>
   52 EOF
   53 
   54 tmpfiles="$tmpfiles af-4-onsgmls.out"
   55 
   56 : ${ONSGMLS=onsgmls}
   57 ${ONSGMLS} >af-4-onsgmls.out -A open af-4.sgml
   58 
   59 tmpfiles="$tmpfiles af-4-onsgmls.ok"
   60 cat <<EOF >af-4-onsgmls.ok
   61 (OPEN
   62 (STANZA
   63 AV CDATA 1
   64 (VERSE
   65 -verse 1
   66 )VERSE
   67 AV CDATA 2
   68 (VERSE
   69 -verse 2
   70 )VERSE
   71 )STANZA
   72 )OPEN
   73 C
   74 EOF
   75 
   76 : ${DIFF=diff}
   77 ${DIFF} af-4-onsgmls.ok af-4-onsgmls.out
   78 result=$?
   79 test $result = 0 || { rm -fr $tmpfiles; exit 1; }
   80 
   81 tmpfiles="$tmpfiles af-4-norm.out"
   82 : ${OSGMLNORM=osgmlnorm}
   83 ${OSGMLNORM} >af-4-norm.out -A open af-4.sgml
   84 tmpfiles="$tmpfiles af-4-norm.ok"
   85 
   86 cat <<EOF >af-4-norm.ok
   87 <OPEN>
   88 <STANZA>
   89 <VERSE V="1">verse 1</VERSE>
   90 <VERSE V="2">verse 2</VERSE>
   91 </STANZA>
   92 </OPEN>
   93 EOF
   94 
   95 ${DIFF} af-4-norm.ok af-4-norm.out
   96 result=$?
   97 test $result = 0 || result=$(($result + 1))
   98 
   99 rm -fr $tmpfiles
  100 
  101 exit $result