> You have two basic problems (both namespace related). > First you are using createElement instead of createElementNS with > the SVG namespace: > > > Element g = svg.createElement("g"); > > Second the SVG elements in your view document are not in the > SVG namespace they are in the no-name namespace, so although the > tag name is the same they are not SVG element's and hence aren't > rendered. > > > <?xml version="1.0" encoding="UTF-8"?> > > <MetaList> > [....] > > <line Type="Line" style="fill:rgb(255,255,255);fill- opacity:1;stroke:rgb(0,0,0);stroke-opacity:1;" > > x1="0" y1="0" x2="24" y2="24" /> > > Probably the easiest thing to do would be to add an xmlns:svg > decl to your root element and then prefix the SVG elements with > 'svg:': > <svg:line ..../>
Thank you for your answer. But I am new to svg,and I have tried many times,it also failed. If I change the meta.xml to a standard svg file, use JSVGCanvas.loadSVGDocument() method I can get svg element.but if I use DocumentBuilderFactory.newInstance().newDocumentBuilder().parse (String file) , I can only get xml element,and it can't cast to svg element. So, I think if I use parse() method to get Document, I don't get svg element. If I want to get a svg element, I should use loadSVGDocument() to load a svg file. Is that right? ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/