File: iptc.awk

package info (click to toggle)
exiv2 0.20-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 13,080 kB
  • ctags: 6,382
  • sloc: cpp: 56,011; sh: 10,092; ansic: 1,622; makefile: 594; awk: 92; python: 36; sed: 16
file content (48 lines) | stat: -rw-r--r-- 1,580 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
################################################################################
# File     : iptc.awk
# Version  : $Rev: 570 $
# Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
# History  : 07-Feb-04, ahu: created
#
# Description:
#  Awk script to convert a taglist to XML format used in the documentation.
#  $ taglist [SectionName] | awk -f iptc.awk > iptc.xml
################################################################################

BEGIN {
   FS = ", "
   print "<?xml version = '1.0'?>";   
   print "<?xml-stylesheet type=\"text/xsl\" href=\"iptc.xsl\"?>";

   print "<TAGLIST>"
   print "<HEADER>"
   print "<title>Iptc datasets defined in Exiv2</title>"
   print "<text>"
   print "<p>Datasets are defined according to the specification of the Iptc "
   print "<a href=\"http://www.iptc.org/IIM/\">Information Interchange Model (IIM)</a>.</p>"
   print "<p>Click on a column header to sort the table.</p>"
   print "</text>"
   print "</HEADER>"
   print "<ROWSET>"
}

{
   print "   <ROW num=\"" ++row "\">";
   print "      <tagname>" $1 "</tagname>"
   print "      <tagdec>" $2 "</tagdec>"
   print "      <taghex>" $3 "</taghex>"
   print "      <recname>" $4 "</recname>"
   print "      <mandatory>" $5 "</mandatory>"
   print "      <repeatable>" $6 "</repeatable>"
   print "      <minbytes>" $7 "</minbytes>"
   print "      <maxbytes>" $8 "</maxbytes>"
   print "      <key>" $9 "</key>"
   print "      <type>" $10 "</type>"
   print "      <tagdesc>" $11 "</tagdesc>"
   print "   </ROW>";
}

END {
   print "</ROWSET>"   
   print "</TAGLIST>"
}