-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi David,
I've attached a document that I then manipulate, to demonstrate the problem I'm still having... I insert a new child <use/> in the document, then add an "xlink:href" attribute. This somehow mangles the xlink namespace declaration in the <svg/> element. BTW, note that the graph.xml here is the same as the one I had sent with the clone-node problem. I have made sure when parsing that the DTD is available and included when the document is parsed. I don't know if that will make a difference in your testing.
Sunil
CL-USER(22): (dom:insert-before (dom:document-element /d) (dom:create-element-ns /d "http://www.w3.org/2000/svg" "use") nil) #<RUNE-DOM::ELEMENT use @ #x20bdbaca> CL-USER(23): (dom:set-attribute-ns * "http://www.w3.org/1999/xlink" "href" "#nothing") CL-USER(24): (dom:map-document (cxml:make-namespace-normalizer (cxml:make-octet-stream-sink *standard-output*)) /d :include-doctype :canonical-notations) <svg xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> <defs> <rect fill="black" height="10" id="default-node-shape" stroke="blue" width="60"></rect> </defs> <use xlink:href="#nothing"></use></svg> #<MULTIVALENT stream socket connected from localhost/3982 to localhost/3983 @ #x205003d2>
Sunil Mishra wrote:
Hi David,
Thanks for the fixes, they do address some of the issues I was seeing, but there's still a problem in my program. I will send you another test by Wednesday.
Sunil
David Lichteblau wrote:
Quoting Sunil Mishra (smishra@sfmishras.com):
So, here's what I'm seeing when I try to introduce multiple namespaces into an XML document... Note that the final output states the namespaces for both svg and xlink as implicit. Further, implicit namespace declarations are not necessarily applied to attributes.
Thanks for the reports.
The namespace normalizer (xml/xmlns-normalizer.lisp) is very new and very untested. In addition, there was a buglet in map-document.
(It would be quite helpful if you could come up with more test cases for the namespace normalizer as a basis for a little test suite!)
CL-USER(38): (dom:map-document (cxml:make-namespace-normalizer (cxml:make-octet-stream-sink *standard-output*)) svg :include-doctype :canonical-notations) <svg href="#nothing" xmlns="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"></svg>
Okay, now that gives: <svg NS1:href="#nothing" xmlns="http://www.w3.org/2000/svg" xmlns:NS1="http://www.w3.org/1999/xlink"></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/2000/svg"> <defs> <rect fill="black" height="10" id="default-node-shape" stroke="blue" width="60"></rect> </defs> </svg>
Fixed that too.
Please update to CVS and test again.
Thanks, d.