[Clipart] Re: SVG::Metadata and inkscape
Bryce Harrington
bryce at bryceharrington.com
Wed Aug 4 10:19:02 PDT 2004
On Wed, 4 Aug 2004, [ISO-8859-1] Alberto Simões wrote:
> > > 2. it would be nice to save the svg file after adding a keyword (or
> > > other metadata)
> >
> > Not certain what you mean here...?
>
> I mean, I would like to say:
>
> $svg = new SVG::Metadata;
> $svg->parse("file.svg");
>
> $svg->addkeyword("foo");
> $svg->save;
Ahh, gotcha.
Actually, since SVG::Metadata *only* parses and extracts the metadata,
it doesn't have the full document, so couldn't have a save() routine
like that. However, it does have a routine to re-generate the metadata
section itself, so an approach would be to delete the metadata from the
file and then re-add it.
For example, the remove_rdf routine in svg_annotate does this
(e.g. `svg_annotate --delete`). Unfortunately, svg_annotate doesn't do
keywords yet (but it's on my todo list).
It would probably be better to recast svg_annotate to allow direct
editing of the SVG DOM elements rather than this delete/add approach,
but that'll take more time to get worked out. Some day. :-)
Bryce
More information about the clipart
mailing list