2

I need to know how to parse a svg file using batik svg parser.

Here is my svg file:

<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
 <g>
  <title>Layer 1</title>
  <line id="svg_1" y2="395" x2="449" y1="395" x1="449" opacity="0.5" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="2" stroke="#000000" fill="none"/>
  <path id="svg_2" d="m 200,159 c-3,53 57,-63 57,-63 c 0,0 108,-16 108,-16 c 0,0 73,79 73,79 c 0,0 -32,77 -32,77 c 0,0 -69,74 -69,74 c 0,0 -92,-18 -92,-18 c 0,0 -78,-27 -78,-27 c 0,0 -18,-85 -18,-85 c 0,0 51,-21 51,-21 z" stroke-width="2" stroke="#000000" fill="none"/>
 </g>
</svg>

Now I wanna read ie parse and get only the tag value.

Michaël
  • 3,679
  • 7
  • 39
  • 64
  • You say TAG Value however, there is no tag value. What value are you trying to parse form the svg? Title? – ObieMD5 Jul 22 '13 at 11:23
  • wat i meant as tag value is the tag. reading the id,d,stroke-width etc tat is present inside the path tag. – user2343141 Jul 23 '13 at 10:24
  • Just parse it with an XML library in whatever language. Path would be considered an element, id,d,etc would be considered attributes of that element. Standard XML libraries have this capability. – ObieMD5 Jul 25 '13 at 12:01
  • yes i did the same using SAX parser. but i want to know is how to do the same using batik parser.is it possible? – user2343141 Jul 29 '13 at 06:45

0 Answers0