SVG validity checks
This page is kept for historical interest. Any policies mentioned may be obsolete. If you want to revive the topic, you can use the talk page or start a discussion on the community forum. |
Out of 2871 randomly-selected SVG files from Commons, 13 (about 0.5%) failed to pass a basic XML well-formedness check. From this sample we might expect about 600-800 invalid files total.
Following are the failed images from my sample set, broken down by type of error. --brion 01:08, 6 February 2008 (UTC)
Bad element nesting
editThis is a blatant well-formedness error. No SVG renderer likes these files, and they don't work on the site as is.
- Adams_County_Washington_Incorporated_and_Unincorporated_areas_Lind_Highlighted.svg
- Created with Arkyan's SVGCensus script
- Delaware_County_Indiana_Incorporated_and_Unincorporated_areas_Selma_Highlighted.svg
- Created with Arkyan's SVGCensus script
Bad character encoding
editText in this file is ISO-8859-1, but since there's no XML header declaring this, a conforming XML parser must assume it's UTF-8 and should barf when coming to the non-ASCII bits.
Amusingly, Firefox does render this file, while rsvg doesn't.
- Verhulst-Malthus.svg
- FreeHEP Graphics2D Driver
Unbound namespace: xlink
editThe next couple sections are files which fail to declare all the namespaces used in the document. Possibly these come from bad exporters, or from uncareful manual editing of generated files.
rsvg currently renders these files for you on Wikimedia, but Firefox won't take them if you try to view them inline. I'd consider it reasonable to start rejecting these... but at least some of them would be easy to fix automatically on upload with some sort of lint check.
The xlink namespace is used for links, including internal references within an SVG document, and really ought to be declared when used. :)
- Grubbs2.svg
- Generator: Adobe Illustrator 9.0, SVG Export Plug-In
- Igis_wappen.svg
- Auto-generated by fig2svg tool
- Romanian_Army_Flag_-_1921_official_model.svg
- Creator: CorelDRAW
- Tympanometrie_Schema.svg
- Creator: CorelDRAW
Unbound namespace: sodipodi
editUsed for various metadata by the SVG editors sodipodi and Inkscape.
- Almoravid-empire-fr.svg
- Generator: Adobe Illustrator 11 Build 196, SVG Export Plug-In . SVG Version: 6.0.0 Build 78)
- BSicon_ev2SBHF.svg
- Creator: CorelDRAW
- BSicon_utSTRl.svg
- 女-bronze.svg
- Created with Inkscape (http://www.inkscape.org/)
Unbound namespace: RDF
editGeneral metadata in some files...
- Cities_destroyed_in_Jericho_TV_series.svg
- Generator: Adobe Illustrator 11 Build 196, SVG Export Plug-In . SVG Version: 6.0.0 Build 78)
Unbound namespace: ns
editNot too sure what this one's for. Some sort of editing metadata, looks like.
- Gnome-dev-removable-usb.svg
- Created with Inkscape (http://www.inkscape.org/)