The problem is not with the XML helper but with the way you are generating the SVG markup (you must do it without the "ns0" namespace). For tips on how to do it correctly, see http://stackoverflow.com/questions/3895951/create-svg-xml-document-without-ns0-namespace-using-python-elementtree.
Alternatively, you could manually remove the "ns0" namespace via: svg = svg.replace('ns0:', '') Anthony On Tuesday, July 28, 2015 at 4:52:57 PM UTC-4, jackson.r...@quantachrome.com wrote: > > IN a controller if I return an svg that has full namspace prefixes > (default for the python xml package 'tostring' method )via the XML helper > it is mangled it beyond recognition. The same svg works in emacs as well as > loaded as a file in the bowser. ns0 ns1 etc namepsace prefixes are verbose > but totally legit xml. I wish the python xml package did not add this stuff > ...but still web2py should be able to handle it. > > below is the start of the svg file in question Just to illustrate the > namespace prefixes I am talking about > > <ns0:svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ns0=" > http://www.w3.org/2000/svg" xmlns:ns1=" > http://www.inkscape.org/namespaces/inkscape" xmlns:ns2=" > http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:ns4=" > http://creativecommons.org/ns#" xmlns:ns6="http://www.w3.org/1999/xlink" > xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > height="638.99463" id="svg4250" preserveAspectRatio="xMinYMin meet" > version="1.1" viewBox="0 0 907.35736 638.99463" width="907.35736" > ns2:docname="station1_flow.svg" ns1:version="0.47 r22583" > xml:space="preserve"><ns0:metadata id="metadata4256"><rdf:RDF><ns4:Work > rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource=" > http://purl.org/dc/dcmitype/StillImage" /><dc:title > /></ns4:Work></rdf:RDF></ns0:metadata><ns0:defs id="defs4254"><ns0:marker > id="Arrow1Lstart" orient="auto" refX="0.0" refY="0.0" > style="overflow:visible" ns1:stockid="Arrow1Lstart"><ns0:path d="M 0.0,0.0 > L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " id="path5660" > style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none" > transform="scale(0.8) translate(12.5,0)" /></ns0:marker><ns0:linearGradient > id="linearGradient5560"><ns0:stop id="stop5562" offset="0" > style="stop-color:#84bde7;stop-opacity:1;" /><ns0:stop id="stop5564" > offset="1" style="stop-color:#67a4d0;stop-opacity:0;" > /></ns0:linearGradient><ns0:linearGradient id="linearGradient4110" > ns1:collect="always"><ns0:stop id="stop4112" offset="0" > style="stop-color:#000000;stop-opacity:1;" /><ns0:stop id="stop4114" > offset="1" style="stop-color:#000000;stop-opacity:0;" />................. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.