0

I have added SVG path element into a nodelist and I can print out the length of the list. May I know how to access the path 'd' attribute of the node.

svgDoc = domObj.createDoc(f.toURL().toString()); NodeList svgPathList = svgDoc.getElementsByTagName("path");

I have already tried this but it doesn't work.

svgPathList.item(0).getNodeValue();

  • Not sure in java, but with the dom you can often do something like item[0].getAttribute("d") – Ian Mar 09 '14 at 09:02
  • I have already found the answer from here. http://stackoverflow.com/questions/9132778/parsing-attribute-in-xml-with-dom-parser Thanks – user2893230 Mar 09 '14 at 09:16

0 Answers0