[Clipart] getid3 svg metadata update

Roan Horning roan at horning.us
Sun Oct 15 09:28:17 PDT 2006


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]']

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"

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.

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

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





More information about the clipart mailing list