SVG Source to and from clipboard?

Asked by Keith

Is there a way to display the SVG code for the document being edited? Can this be copied to the Mac OS clipboard? For instance, Sketsa has a "Source Editor" window.

The new version of 4D (4th Dimension, www.4D.com) has lost its drawing module. If there were a SVG editor that could create a drawing from the OS Clipboard containing SVG code and could send its drawing to the clipboard, 4D could easily utilize this data.

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
su_v
Solved:
Last query:
Last reply:
Revision history for this message
pbhj (pbhj) said :
#1

You could just open the SVG file in a text editor. But locating the relevant code to copy a part of the image will be tricky as it tends to be spread around the file somewhat - for example patterns are defined in a different place to the objects that hold those patterns.

Revision history for this message
Best su_v (suv-lp) said :
#2

Inkscape has its built-in XML editor but AFAIK you can't copy the complete edited SVG source code to the clipboard, only single attribute values.

Inkscape of course has its powerful extension system - maybe it is possible to write an extension that displays the current XML tree in a text widget or directly copies it to the clipboard (i.e. to the X11 clipboard, which then needs to be transferred to/synced with the OS X pasteboard)?

Other alternatives: the google project 'svg-edit' <http://code.google.com/p/svg-edit/> might be able to replace the drawing module? (Online demo: <http://svg-edit.googlecode.com/svn/tags/stable/editor/svg-editor.html>)

Revision history for this message
Keith (kec) said :
#3

I'll keep exploring Inkscape and watching for new extensions. Thanks!

Revision history for this message
Keith (kec) said :
#4

Thanks ~suv, that solved my question.