[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file magic for SVG

From: Alan Horkan
Subject: Re: file magic for SVG
Date: Tue, 28 Jun 2005 14:23:15 +0100 (BST)

> | 0       string/cB       \<!DOCTYPE\ svg         SVG image data
> | 0       string/c        \<svg                   SVG image data
> What the specification? Is <svgfoo> a valid SVG file?

I dont have hte specifications memorised but I can tell you most of the
SVG files I have are roughly of the form

<?xml version="1.0"?>
<!DOCTYPE svg   ...
<svg   ...

with the all the usual variations from the <?xml ?>

I believe the doctype is strongly recommended but not strictly
required, and is of the following form but often includes many other
namespaces such as Xlink, Dublin Core and others and sometimes other junk.
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"

The <svg> almost always includes extra information, some kind of height
width dimenions or a view box size.

Quite a few programs insert a comment between the doctype and the <svg>
tag and put some sort of advertising/generator information there.

So as you can see my effort (much like the existing magic for HTML) will
only identify a few very contrived versions of SVG and I badly need help
making it more robust.


Alan Horkan

Inkscape http://inkscape.org
Open Clip Art http://OpenClipArt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]