[Clipart] upload script suggestion

Stephen Silver ocalocal at btinternet.com
Tue Mar 22 11:45:15 PST 2005


Jonadab wrote:

> "Jonadab the Unsightly One" <jonadab at bright.net> writes:
> 
> >> The only correct thing to do here is to use an XML parser.  
> >
> > If we have to, we have to, but I suspect it's not necessary.

I think it's necessary, because the regular expressions will always
be fooled in some situations.  For example, these two files in the
incoming folder still have Adobe Illustrator metadata, because the
regular expression didn't notice it, and they have no OCAL metadata,
because the regular expression couldn't find a place to put it:

 horse_1_konstantin_r._01.svg
 horse_2_konstantin_r._01.svg

> I'm not sure meta-metadata will ever occur in practice,

It occurs in horse_2_konstantin_r._01.svg.

> > I can certainly fix it so it doesn't match tags that end in />,
> > much more easily than walking an XML tree.
> 
> Although, if there were an XML equivalent for HTML::Tree (with its
> nifty look_down method), that would make it more reasonably doable.

It only takes a few lines in Andrew Archibald's Python script to walk
the XML tree.  I don't think it can be that much harder in Perl.

-- 
Stephen Silver




More information about the clipart mailing list