anchor.diff:  ;;;;    Boston, MA 02111-1307 USA
   ;;;;****************************************************************************
   
  -(IN-PACKAGE "COMMON-LISP-USER")
  -(DEFPACKAGE "COM.INFORMATIMAGO.COMMON-LISP.HTML-GENERATOR.HTML-PARSER.PARSE-HTML"
  -  (:USE "COMMON-LISP"
  +(in-package "COMMON-LISP-USER")
  +(defpackage "COM.INFORMATIMAGO.COMMON-LISP.HTML-PARSER.PARSE-HTML"
  +  (:use "COMMON-LISP"
           "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.UTILITY"
           "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.LIST"
           "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STRING"
           "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.PEEK-STREAM"
           "COM.INFORMATIMAGO.COMMON-LISP.HTML-GENERATOR.HTML-ENTITIES")
  -  (:EXPORT "HTML-ATTRIBUTE" "HTML-CONTENTS" "HTML-ATTRIBUTES" "HTML-TAG"
  +  (:export "HTML-ATTRIBUTE" "HTML-CONTENTS" "HTML-ATTRIBUTES" "HTML-TAG"
              "UNPARSE-HTML" "WRITE-HTML-TEXT"
              "PARSE-HTML-STRING" "PARSE-HTML-FILE")
  -  (:IMPORT-FROM "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STRING" "UNSPLIT-STRING"
  +  (:import-from "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STRING" "UNSPLIT-STRING"
                   "SPLIT-STRING" "STRING-REPLACE")
  -  (:DOCUMENTATION "This package exports functions to parse HTML pages."))
  -(IN-PACKAGE "COM.INFORMATIMAGO.COMMON-LISP.HTML-GENERATOR.HTML-PARSER.PARSE-HTML")
  +  (:documentation "This package exports functions to parse HTML pages."))
  +(in-package "COM.INFORMATIMAGO.COMMON-LISP.HTML-PARSER.PARSE-HTML")
   
   
   ;; ------------------------------------------------------------------------
   
   (eval-when (:compile-toplevel :load-toplevel :execute)
     (defparameter +tag-package+ (find-package "KEYWORD"))
  -  (DEFVAR *ATTRIBUTES* () "List of symbols of all attributes defined.")
  -  (DEFVAR *ELEMENTS*   () "List of symbols of all elements defined."))
  +  (defvar *attributes* () "List of symbols of all attributes defined.")
  +  (defvar *elements*   () "List of symbols of all elements defined."))
   
   (eval-when (:compile-toplevel :load-toplevel :execute)
   
  -  (DEFMACRO DEFATTRIBUTE (ATTR-NAME ELEMENTS TYPE DEFAULT OPTIONS DOCUMENTATION)
  +  (defmacro defattribute (attr-name elements type default options documentation)
       "
   DO:       Defines an HTML attribute.
   "
  -    (declare (ignore ATTR-NAME ELEMENTS TYPE DEFAULT OPTIONS DOCUMENTATION))
  +    (declare (ignore attr-name elements type default options documentation))
       ;; NOP
  -    (VALUES))
  +    (values))
     );;eval-when
   
   (eval-when (:compile-toplevel :load-toplevel :execute)
  -  (DEFSTRUCT ELEMENT
  -    NAME OPTIONS DOCUMENTATION))
  +  (defstruct element
  +    name options documentation))
   
   
   (defun find-element (element-name) (getf *elements* element-name))
   
   
  -(DEFUN ELEMENT-EMPTY-P (ELEMENT-NAME)
  -  (and (find-element ELEMENT-NAME)
  -       (MEMBER :EMPTY (ELEMENT-OPTIONS (find-element ELEMENT-NAME))
  -               :TEST (FUNCTION EQ))))
  -
  -
  -(DEFUN ELEMENT-START-OPTIONAL-P (ELEMENT-NAME)
  -  (or (not (find-element ELEMENT-NAME))
  -      (MEMBER :START-OPTIONAL (ELEMENT-OPTIONS (find-element ELEMENT-NAME))
  -              :TEST (FUNCTION EQ))))
  -
  -
  -(DEFUN ELEMENT-END-OPTIONAL-P (ELEMENT-NAME)
  -  (or (not (find-element ELEMENT-NAME))
  -      (MEMBER :END-OPTIONAL (ELEMENT-OPTIONS (find-element ELEMENT-NAME))
  -              :TEST (FUNCTION EQ))))
  -
  -
  -(DEFUN ELEMENT-END-FORBIDDEN-P (ELEMENT-NAME)
  -  (and (find-element ELEMENT-NAME)
  -       (MEMBER :END-FORBIDDEN (ELEMENT-OPTIONS (find-element ELEMENT-NAME))
  -               :TEST (FUNCTION EQ))))
  +(defun element-empty-p (element-name)
  +  (and (find-element element-name)
  +       (member :empty (element-options (find-element element-name))
  +               :test (function eq))))
  +
  +
  +(defun element-start-optional-p (element-name)
  +  (or (not (find-element element-name))
  +      (member :start-optional (element-options (find-element element-name))
  +              :test (function eq))))
  +
  +
  +(defun element-end-optional-p (element-name)
  +  (or (not (find-element element-name))
  +      (member :end-optional (element-options (find-element element-name))
  +              :test (function eq))))
  +
  +
  +(defun element-end-forbidden-p (element-name)
  +  (and (find-element element-name)
  +       (member :end-forbidden (element-options (find-element element-name))
  +               :test (function eq))))
   
   (eval-when (:compile-toplevel :load-toplevel :execute)
  -  (DEFMACRO DEFELEMENT (NAME OPTIONS &OPTIONAL (DOCUMENTATION "A HTML element."))
  +  (defmacro defelement (name options &optional (documentation "A HTML element."))
       "
   DO:         Defines a HTML element macro.
   NAME:       A symbol that will be used to define a macro.
  
positive.code:             :FRAMESET-DTD   -> error when *DOCTYPE* isn't :FRAMESET.
  DOCUMENTATION:  A string used as documentation string for the macro NAME.
  "
      (WITH-GENSYMS (GNAME)
        `(LET ((,GNAME (INTERN ,(STRING NAME) +tag-package+)))
              (PUSH (MAKE-ELEMENT :NAME ,GNAME
                                  :OPTIONS ',OPTIONS
                                  :DOCUMENTATION ',DOCUMENTATION) *ELEMENTS*)
              (PUSH ,GNAME *ELEMENTS*))))
    );;eval-when
  
  ;; (eval-when (:compile-toplevel :load-toplevel :execute)
  
negative.code:     (write-text html)))
  
  
  ;;;; THE END ;;;;
  
  