I know that this is the expected behavior, but I cannot find a manner
to override this behavior to have the quotes survive.
For example, what I want:
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
What I get:
var map = new
google.maps.Map(document.getElementById("map_canvas"),
myOptions);
What do you suggest I do to get the desired behavior without rewriting
xml.dom? Or is overriding the method the best way to go?
def _write_data_no_quote(writer, data):
"Writes datachars to writer."
data = data.replace("&", "&").replace("<", "<")
data = data.replace(">", ">")
writer.write(data)
minidom._write_data = _write_data_no_quote
Maybe this is the best way to do this. I'm not sure.
You should use an HTML generator tool rather than a generic XML tool like
xml.dom.minidom. You need something that knows that the <script> tag
contains CDATA content in HTML, and that can serialise in an HTML aware way
(self-closing tags, etc.).
Check the Python Wiki or PyPI, they have tons of HTML generators.
Stefan
Thank you. The reason that I am using xml.dom.minidom is that I am
restricted to a stock RHEL5 stack. That means 2.4 with nothing added.
(Welcome to US Army IT !!!)
But, I figured out that I need to back up from xml.dom.minidom to
xml.dom and then I can use createCDATASection and get what I need.
Now I am off to fix the issue solving this unmasked. (Google Maps API
v3 doesn't like to be in an HTML 4.01 Transitional page. Ugh)
Thanks