"Fossies" - the Fresh Open Source Software Archive

Member "OpenSP-1.5.2/tests/af-5" (14 May 2005, 1904 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 ArcSupr:
    3 #    suppress element "v", but keep CDATA of this element
    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-5.sgml af-5.dtd af-meta-5.dtd"
   13 cat <<EOF >af-5.sgml
   14 <!DOCTYPE doc SYSTEM "af-5.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-5.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     ArcSupr NAME #FIXED "doc-proc"
   30     ArcDTD CDATA #FIXED "opendtd">
   31 <!ENTITY opendtd SYSTEM "af-meta-5.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-proc CDATA #FIXED "sArcForm">
   43 EOF
   44 
   45 cat <<EOF >af-meta-5.dtd
   46 <!ELEMENT open     - o (stanza+)>
   47 <!ELEMENT stanza   - o (#PCDATA)> <!-- (verse+) -->
   48 
   49 <!-- ELEMENT verse    - o (#PCDATA) -->
   50 <!-- ATTLIST verse
   51   v CDATA #REQUIRED -->
   52 EOF
   53 
   54 tmpfiles="$tmpfiles af-5-onsgmls.out"
   55 
   56 : ${ONSGMLS=onsgmls}
   57 ${ONSGMLS} >af-5-onsgmls.out -A open af-5.sgml
   58 tmpfiles="$tmpfiles af-5-onsgmls.ok"
   59 cat <<EOF >af-5-onsgmls.ok
   60 (OPEN
   61 (STANZA
   62 -verse 1verse 2
   63 )STANZA
   64 )OPEN
   65 C
   66 EOF
   67 
   68 : ${DIFF=diff}
   69 ${DIFF} af-5-onsgmls.ok af-5-onsgmls.out
   70 result=$?
   71 test $result = 0 || { rm -fr $tmpfiles; exit 1; }
   72 
   73 tmpfiles="$tmpfiles af-5-norm.out"
   74 : ${OSGMLNORM=osgmlnorm}
   75 ${OSGMLNORM} >af-5-norm.out -A open af-5.sgml
   76 tmpfiles="$tmpfiles af-5-norm.ok"
   77 
   78 cat <<EOF >af-5-norm.ok
   79 <OPEN>
   80 <STANZA>verse 1verse 2</STANZA>
   81 </OPEN>
   82 EOF
   83 
   84 ${DIFF} af-5-norm.ok af-5-norm.out
   85 result=$?
   86 test $result = 0 || result=$(($result + 1))
   87 
   88 rm -fr $tmpfiles
   89 
   90 exit $result