I followed the link given and used lxml package instead of xml and it 
works. lxml does not add the prefixes that xmk does. The lxml API is a 
superset of the xml API so I did not have to change the code much. BTW  I 
tried removing the ns0 prefix in the svg as per the suggestion the svg 
displays but the xlinks in it are no longer active

On Tuesday, July 28, 2015 at 4:52:57 PM UTC-4, jackso...@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.

Reply via email to