aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfdf.lisp
blob: fd8c8b73f5b2e310ff15d3988b8415ae90a373e8 (plain)
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
(in-package :xfdf)

(defun write-xfdf (output-stream fields)
  (format output-stream "~
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<xfdf xmlns=\"http://ns.adobe.com/xfdf/\" xml:space=\"preserve\">
	<fields>
")

  (loop for (name . value) in fields
        do
        (let ((value (cond ((eq value t) "Yes")
                           ((eq value nil) "Off")
                           (t value))))
          (format output-stream "		<field name=\"~A\">
			<value>~A</value>
		</field>
"
name
value)))

  (format output-stream "	</fields>
</xfdf>")

  output-stream)