Re: WebMathematica and SVG graphics
- To: mathgroup at smc.vnet.net
- Subject: [mg117998] Re: WebMathematica and SVG graphics
- From: Alexey <lehin.p at gmail.com>
- Date: Fri, 8 Apr 2011 04:13:08 -0400 (EDT)
- References: <ink9ai$g9q$1@smc.vnet.net>
Eduardo <eduzea at gmail.com> wrote: > Thanks to all for the useful replies. > > Does anyone know if this behavior Alexey describes (Mathematica connecting to http://www.w3.org/to evaluate XML`SVG`GraphicsToSymbolicSVG or ImportString[..., "XML"]), can be modified or configured? > > Thanks and regards, > > Eduardo. For preventing Internet requests you can use option "ReadDTD"->False though the result will be slightly different: In[1]:= xml1=ImportString[ExportString[Plot[x^4,{x,0,1}],"SVG"],"XML", "ReadDTD"->False]; xml2=ImportString[ExportString[Plot[x^4,{x,0,1}],"SVG"],"XML"]; xml1===xml2 Complement[xml2,xml1] AppendTo[xml1,"Valid"->True]===xml2 Out[3]= False Out[4]= XMLObject[Document][Valid->True] Out[5]= True Interestingly, there is another related option in the Documentation: "AllowRemoteDTDAccess". But with this option ImportString fails: ImportString[ExportString[Plot[x^4,{x,0,1}],"SVG"],"XML", "AllowRemoteDTDAccess"->False]; XML`Parser`XMLGetString::prserr: StyleBox[RuntimeException:Could not open DTD file'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' atLine:1Character:99,MT] Both these options absent in Mathematica 5.2. Alexey