blob: d64aa2989d9fe686b0c702c8529a766b96bf0249 (
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
26
27
|
(in-package :xfdf)
(defun write-xfdf (output-stream fields)
"Write an XFDF document to `output-stream` using cons cells in the `fields`
list."
(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)
|