Hi,
I want to replace text content from code. with out using xml editor.
Like if i draw Text 'I' on inkscape. using XML Editor i can replace any text on 'I'
But if doing same operation from coding then how's it's possible ?
XML Edit text content ?
Re: XML Edit text content ?
Hmm, without using the XML editor, I'd use something called regular expressions (on Linux there is the sed command, I'm not sure about Windows)...
But I'm not sure whether you'd like to do this inside Inkscape (i.e. using an extension), or from the outside (i.e. just manipulating the SVG file)? What exactly do you mean with the "... from code ..." part in your post?
But I'm not sure whether you'd like to do this inside Inkscape (i.e. using an extension), or from the outside (i.e. just manipulating the SVG file)? What exactly do you mean with the "... from code ..." part in your post?
Re: XML Edit text content ?
Ailurus wrote:on Linux there is the sed command, I'm not sure about Windows
Some GNU tools have been ported to Windows by the GNUwin project. Sed is available at http://gnuwin32.sourceforge.net/packages/sed.htm
Re: XML Edit text content ?
Ehhmm,.. how about doing that with javascript, document.getAttributeNS(null,"text") and then replacing the childNode.value (as the text is actually a childNode of the text element). It actually is quite easy to do that in javascript. On pilat.free.fr and learnsvg.org you can find both a very good book on the topic and a set of tutorials that will tell you exactly what methods to use and a code example.