[Clipart] getid3 svg metadata update

Jon Phillips jon at rejon.org
Sun Oct 15 20:30:13 PDT 2006

On Sun, 2006-10-15 at 12:28 -0400, Roan Horning wrote:
> Hi,
> Just wanted to let people know I have been working on svg support in getid3.


> It will now return information from all <metadata> tags found in an svg
> file. It needs some tweaking to make sure I am getting all the attribute
> information from the metadata tag itself. The information is returned in
> a muti-dimensional array using parts of the XPath as the array keys:
> XPath =  /svg[1]/metadata[1]/title[1]
> Array = $meta['svg[1]'][metadata['[1]']['title[1]']

Very smart!

> For a demo of the new info. returned see
> "http://www.justjohnnyweb.net/getid3/demos/demo.browse.php?listdirectory=%2Fvar%2Fwww%2Fjustjohnnyweb%2Fgetid3"
> I have placed the documentation for the XPath library being used at
> "http://www.justjohnnyweb.net/getid3/Php.XPathDocumentation.html"

This is major good news!

> I have also changed the way that the module will check to see if it is
> an svg file.  It no longer requires the first line to have an XML
> declaration like "<?xml version="1.0" encoding="UTF-8"
> standalone="no"?>".  I let the XPath library check that it is a
> well-formed xml file, and then check to make that the root tag is and
> <svg> tag to determine if the file is an svg file. It's a little bit of
> a speed hit this way, but we get better error messages returned by the
> XPath library. See the test-with-xml-error.svg file.

Right, this really makes sense and sense its not something done on
navigation, is fine IMO.

> The XML declaration is a "should" recommendation of the xml specs. I
> plan to add and XMLdeclaration variable to the data returned by the
> getid3 svg module. This will have a TRUE/FALSE value. We can then decide
> if we want to "fix" this problem when the file is uploaded.
> I also plan to add a similar value for document type declaration which
> is required if we are trying for a valid xml file: see
> http://www.w3.org/TR/2004/REC-xml-20040204/#sec-prolog-dtd

Yep, this is a great idea.

> We have had write capabilities since the inclusion of the XPath
> library.  I have started learning how to use it and figuring out some if
> its quirks. I'll try to get some demo pages up within the next day or so.
> --Roan

Yes, this would be great to get into getid3...we could also start to
test the code on cchost if you feel it is ready :)

This is really great Roan! Can we all help you?


Jon Phillips

San Francisco, CA
USA PH 510.499.0894
jon at rejon.org

MSN, AIM, Yahoo Chat: kidproto
Jabber Chat: rejon at gristle.org
IRC: rejon at irc.freenode.net

More information about the clipart mailing list