[Solved] <inkscape:grid (Code-question)

Discuss SVG code, accessible via the XML Editor.
Amadeus12
Posts: 66
Joined: Sat Sep 11, 2010 4:20 pm

[Solved] <inkscape:grid (Code-question)

Postby Amadeus12 » Wed Jul 17, 2013 2:12 am

I can't make head or tails on this code in a svg-file:

Code: Select all

 <inkscape:grid
type="xygrid"
id="grid4737"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />

When you open the file in inkscape, you can't see any grid. I ask this question because the validator of W3C gives an error on this.
Last edited by Amadeus12 on Wed Jul 17, 2013 3:54 pm, edited 1 time in total.

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: <inkscape:grid (Code-question)

Postby hulf2012 » Wed Jul 17, 2013 2:59 am

Hello:
- I don't know what you mean about "heads or tails"
- Have you done that code IN Inkscape or with a text editor?. Have you checked the Inkscape preferences or the View Menu?
- I don't know about the W3C validator, but some Inkscape labels, may not be recognized by other software, because they are only for the use of Inkscape.

It's better if you can provide all the SVG file. Not me, but others could give you a better answer.
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

Amadeus12
Posts: 66
Joined: Sat Sep 11, 2010 4:20 pm

Re: <inkscape:grid (Code-question)

Postby Amadeus12 » Wed Jul 17, 2013 5:52 am

-"Head or tails": I meant to say that I don't understand it at all.
- Of course I know how to switch on and off the grid-fuction in Inkscape. And yes, I know how to change the grid in the preferences. The code is part of a much, much larger code and I am not going to post that here. Opening the file in Inkscape doesn't show the grid. So the question is why because the code contains a specific part on grid.
- You don't know the W3C-validator? Long live Google: http://www.validator.w3.org.

User avatar
tomh
Posts: 218
Joined: Sat Feb 14, 2009 10:14 pm

Re: <inkscape:grid (Code-question)

Postby tomh » Wed Jul 17, 2013 7:31 am

1) this is so that Inksacape can remember the setting you use when/if you set up the "grid" guides: Document Properties (ctrl+shift+P) -> Grids. Toggle on/off using #

2) Properly name-spaced xml elements should not be causing problems with the w3g validator [well, they might, but it is valid xml]:

Basically, the SVG specification has mostly been created with display attributes/elements in mind. To preserve useful editing information, Inkscape has added its own set of XML elements+attributes, which other programs should ignore - they are in there own namespace, and do not affect the rendering of the final SVG, but enable a better editing experience. Grids and guides are one of these.

3) By default, the svg's that Inkscape creates use multiple namespaces - The first part of the SVG element:

Code: Select all

<svg xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" ...


This basically states that the xml document contains more than just svg. Any element that starts with "<svg:" or "<" should be treated as SVG,
everything else, prefixed with e.g. < inkscape: is not svg, but belongs to another type of xml document. When displaying the SVG theses should be ignored, but they have specific meanings for other editors/search engines.

4) If you save a file from Inkscape using the "plane svg" option, it should only save the svg portion of the file. If you still get errors with extra namespaces then this is an error.

Amadeus12
Posts: 66
Joined: Sat Sep 11, 2010 4:20 pm

Re: <inkscape:grid (Code-question)

Postby Amadeus12 » Wed Jul 17, 2013 3:53 pm

I found the solution: I saved the file in plain svg and the code that I was used to, appeared. The inkscape-code appeared to be a setting that was stored in the file by Inkscape.

Thank you for your answers.


Return to “SVG / XML Code”