[Developers] mjt xhtml
vtalwar at berkeley.edu
vtalwar at berkeley.edu
Tue Apr 3 04:33:16 UTC 2007
Hi all,
The thought of using mjt to create svg's recently popped into my head. I
tried making a simple example but a crippling problem arose (in Firefox
2.0) which seems to have to do with XML vs. HTML. I spent about a couple
of hours looking through mjt.js for the source to no avail.
Essentially what's happening is that when the attributes are generated for
"top", you get something like this trying to be created in the XML
document:
<DIV style="display: none;" id="top" id="top">1</DIV>
(this markup is from the flatten_markup function)
This is fine in the HTML document but is problematic for the XML document
since it doesn't allow for duplicate attributes (the id attr). The end
result is that setting the innerHTML value for tmpdiv in replace_html()
has no effect (since the xml doesn't validate I guess? not sure...). I got
around this problem by changing using createElementNS with
"http://www.w3.org/TR/REC-html40" to create tempdiv and also the original
"top" div but then document.getElementById doesn't seem to be able to find
"top" (maybe since it has a different namespace now? not sure again...).
Any suggestions would be much appreciated :)
Thanks,
Vishal
More information about the Developers
mailing list