[Clipart] getid3 svg metadata update
roan at horning.us
Sun Oct 15 09:28:17 PDT 2006
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/metadata/title
Array = $meta['svg'][metadata['']['title']
For a demo of the new info. returned see
I have placed the documentation for the XPath library being used at
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
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.
More information about the clipart