To edit the XML file, open the XML Editor dialog ( → (Shift+Ctrl+X)). This will open a window like the following for an empty drawing.
The “tree” structure of the empty drawing is shown on the right in the dialog. Even an empty Inkscape drawing contains information including an empty Layer ("layer1"). The Layer, like all the items listed, is represented by a “node” in the tree. If the layer contained objects, they would be represented by nodes under the layer's node. The objects under a particular node can be hidden in the tree view. To hide and unhide these objects click on the small triangles just in front of a node's name.
Upon adding an ellipse to the drawing, an entry (node) is added for the new ellipse under the formerly empty Layer (see next figure). The line is highlighted and the ellipse's parameters are shown on the left. Note that the name of the object is given in the highlighted line (in this case, "path1599").
Now, suppose you would like the ellipse to have a width of 400 pixels (i.e., a radius of 200 pixels in the x direction). You can specify this by clicking on the “sodipodi:rx” attribute. The attribute is shown below with the current value in the attribute entry box. Change that value to 200 and then click on the Set button (or use Ctrl+Enter).
The ellipse should now be 400 pixels wide. You could also change the height (sodipodi:ry) and the location of the center of the ellipse (sodipodi:cx and sodipodi:cy). And you can change attributes like the Fill color and Stroke style.
Elements in the Inkscape file fall under two categories: those included in the SVG standard and those that are private to Inkscape. In the above example, the attributes with the “sodipodi” tag are internal to Inkscape (the “sodipodi” tag is the result of Inkscape being branched from the Sodipodi program). These attributes are used to calculate the “real” SVG path definition given by the 'd' attribute. (See the section called “Paths” in Appendix B, File Format.)
The Inkscape internal elements should be ignored by other SVG rendering programs. This may not always be true, thus Inkscape includes the possibility to export a drawing without the Inkscape internal elements.
Sometimes it is useful to know what the allowed attributes are for a given type of object. The SVG standard is described in detail at the Official W3C SVG website. Note that not all the SVG standard is currently supported in Inkscape. It is possible, however, to add nonsupported attributes via the XML Editor. These attributes may not be displayed by Inkscape but will appear in any program that supports those attributes.
|© 2005-2010 Tavmjong Bah.||Get the Book or PDF.|