From f40ea60f4d767c2ce84a41ca6989750534dee3f7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 16 Apr 2023 20:30:36 +0200 Subject: Output XFDF fields into XML Write `` elements to the XFDF XML based on the cons cells in the `fields` input list. Change true and nil values to the FDF/XFDF checkbox value format of "Yes" and "Off". Also decided to use lowercase `t` to match the case of `nil`. Not sure if that makes sense. --- src/xfdf.lisp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/xfdf.lisp b/src/xfdf.lisp index a61fcdd..fd8c8b7 100644 --- a/src/xfdf.lisp +++ b/src/xfdf.lisp @@ -7,18 +7,17 @@ ") - ;; TODO - ; (loop do) - (format output-stream " - Yes + (loop for (name . value) in fields + do + (let ((value (cond ((eq value t) "Yes") + ((eq value nil) "Off") + (t value)))) + (format output-stream " + ~A - - Off - - - 123 Fake Street, Springfield - -") +" +name +value))) (format output-stream " ") -- cgit v1.2.3