X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=views.lisp;h=b609ca08a772aa837ce86e94567a5e748e141e80;hb=2ec170fb14c93a96313863aa47892bf1187503dc;hp=fadc3ba1736479d035975a40eab26c2bdbfb3593;hpb=d3dd5096c102155d3c5dba9642bbcf4d6f78928e;p=hyperobject.git diff --git a/views.lisp b/views.lisp index fadc3ba..b609ca0 100644 --- a/views.lisp +++ b/views.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: views.lisp,v 1.16 2002/12/13 12:23:17 kevin Exp $ +;;;; $Id: views.lisp,v 1.19 2002/12/26 12:04:00 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; @@ -162,6 +162,7 @@ ) ) + (defun initialize-view-by-category (obj-cl view) "Initialize a view based upon a preset category" (let ((fmtstr nil) @@ -173,7 +174,8 @@ (unless (in category :compact-text :compact-text-labels :html :html-labels :html-link-labels :xhtml :xhtml-labels :xhtml-link-labels - :xml :xml-labels :xml-link-labels) + :xml :xml-labels :xml-link :ie-xml-link + :xml-link-labels :ie-xml-link-labels) (error "Unknown view category ~A" category)) (unless (slots view) @@ -182,10 +184,12 @@ (let ((slot (find-slot-by-name obj-cl slot-name))) (unless slot (error "Slot ~A is not found in class ~S" slot-name obj-cl)) - (let ((name (slot-definition-name slot)) - (namestr-lower (string-downcase (symbol-name (slot-definition-name slot)))) - (type (slot-value slot 'type)) - (print-formatter (esd-print-formatter slot))) + (let* ((name (slot-definition-name slot)) + (namestr-lower (string-downcase (symbol-name name))) + (xml-namestr (escape-xml-string namestr-lower)) + (xml-tag (escape-xml-string namestr-lower)) + (type (slot-value slot 'type)) + (print-formatter (esd-print-formatter slot))) (cond (first-field @@ -214,19 +218,19 @@ (:html-labels (string-append fmtstr (concatenate 'string "" namestr-lower " " value-fmt ""))) (:xhtml-labels - (string-append fmtstr (concatenate 'string " " value-fmt ""))) + (string-append fmtstr (concatenate 'string "" xml-namestr " " value-fmt ""))) (:xml-labels - (string-append fmtstr (concatenate 'string " <" namestr-lower ">" value-fmt ""))) + (string-append fmtstr (concatenate 'string " <" xml-tag ">" value-fmt ""))) ((or :html-link :xhtml-link) (push name links) (if (esd-hyperlink slot) (string-append fmtstr "<~~a>" value-fmt "") (string-append fmtstr (concatenate 'string "" value-fmt "")))) - (:xml-link + ((or :xml-link :ie-xml-link) (push name links) (if (esd-hyperlink slot) (string-append fmtstr "<~~a>" value-fmt "") - (string-append fmtstr (concatenate 'string "<" namestr-lower ">" value-fmt "")))) + (string-append fmtstr (concatenate 'string "<" xml-tag ">" value-fmt "")))) (:html-link-labels (push name links) (if (esd-hyperlink slot) @@ -235,19 +239,20 @@ (:xhtml-link-labels (push name links) (if (esd-hyperlink slot) - (string-append fmtstr "<[!CDATA[" namestr-lower "]]> <~~a>" value-fmt "") - (string-append fmtstr (concatenate 'string " " value-fmt "")))) - (:xml-link-labels + (string-append fmtstr "" xml-namestr " <~~a>" value-fmt "") + (string-append fmtstr (concatenate 'string "" xml-namestr " " value-fmt "")))) + ((or :xml-link-labels :ie-xml-link-labels) (push name links) (if (esd-hyperlink slot) - (string-append fmtstr " <~~a>" value-fmt "") - (string-append fmtstr (concatenate 'string " <" namestr-lower ">" value-fmt ""))))) + (string-append fmtstr " <~~a>" value-fmt "") + (string-append fmtstr (concatenate 'string " <" xml-tag ">" value-fmt ""))))) ) ;; let value-fmt - + (let ((func (if print-formatter `(,print-formatter (slot-value x (quote ,name))) `(slot-value x (quote ,name))))) (when (and (in category :xml :xhtml :xml-link :xhtml-link + :xml-labels :ie-xml-labels :xhtml-link-labels :xml-link-labels :ie-xml-link :ie-xml-link-labels) (or print-formatter