From a044701cf3d86e35d0f97b88d9622702e5d0af34 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Thu, 21 Mar 2002 15:00:59 +0000 Subject: Add header to XML docs --- generic/pg-xml.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/generic/pg-xml.el b/generic/pg-xml.el index 01fcec11..cd53da06 100644 --- a/generic/pg-xml.el +++ b/generic/pg-xml.el @@ -1,6 +1,6 @@ ;; pg-xml.el XML functions for Proof General ;; -;; Copyright (C) 2000-2001 LFCS Edinburgh. +;; Copyright (C) 2000-2002 LFCS Edinburgh. ;; ;; Author: David Aspinall ;; @@ -181,9 +181,11 @@ is ;; Producing functions: state-based writing of an XML doc, ;; built up in pg-xml-doc +(defconst pg-xml-header + "\n") (defvar pg-xml-doc nil - "Current document being written") + "Current document being written (a reversed list of strings).") (defvar pg-xml-openelts nil "Stack of openelements") @@ -191,8 +193,9 @@ is (defvar pg-xml-indentp nil "Whether to indent written XML documents") -(defun pg-xml-begin-write () - (setq pg-xml-doc nil +(defun pg-xml-begin-write (&optional header) + "Start writing an XML document. If HEADER is non-nil, add " + (setq pg-xml-doc (if header (list pg-xml-header)) pg-xml-openelts nil)) (defun pg-xml-indent () @@ -240,7 +243,7 @@ is ;; Test document: ;;(progn -;; (pg-xml-begin-write) +;; (pg-xml-begin-write t) ;; (pg-xml-openelt 'root) ;; (pg-xml-openelt 'a '((class . "1B"))) ;; (pg-xml-writetext "text a") -- cgit v1.2.3