From cdbe1682b71a635f2828ca0fce8efd52472c0ead Mon Sep 17 00:00:00 2001 From: dlichteblau Date: Sun, 14 Oct 2007 20:19:35 +0000 Subject: [PATCH] HAX namespace stuff * xml/sax-handler.lisp (HAX:START-ELEMENT, HAX:END-ELEMENT): Declare and undeclare the xhtml namespace on elements called "HTML". --- xml/sax-handler.lisp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xml/sax-handler.lisp b/xml/sax-handler.lisp index f44e0d5..0c3f958 100644 --- a/xml/sax-handler.lisp +++ b/xml/sax-handler.lisp @@ -429,6 +429,15 @@ Setting this variable has no effect unless both (defmethod hax:start-element ((handler abstract-handler) name attributes) (setf name (runes:rod-downcase name)) + (when (equal name "html") + (sax:start-prefix-mapping handler "" "http://www.w3.org/1999/xhtml") + (when *include-xmlns-attributes* + (push (make-attribute :namespace-uri "http://www.w3.org/2000/xmlns/" + :local-name nil + :qname "xmlns" + :value "http://www.w3.org/1999/xhtml" + :specified-p t) + attributes))) (sax:start-element handler "http://www.w3.org/1999/xhtml" name @@ -440,7 +449,9 @@ Setting this variable has no effect unless both (sax:end-element handler "http://www.w3.org/1999/xhtml" name - name)) + name) + (when (equal name "html") + (sax:end-prefix-mapping handler ""))) (defmethod hax:characters ((handler abstract-handler) data) (sax:characters handler data))