I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-10-06 04:05:21-07 by kailash in response to 8957
Re: XML output option
Yes, "file" tag looks redundant, as the file info will get repeated in the File group. "item" seems okay. or maybe "token", but token is a datatype in W3C XSD. I don't know whether that can be the reason for not using it.
Or probably, root element can be given the name "metadatas" (plural) and the individual file elements as "metadata" (singular), with an attribute giving directory and filename concatenated.

Some examples:
exiftool a.jpg -keywords -X
<?xml version='1.0' encoding='UTF-8'?> <metadatas toolkit='Image::ExifTool 7.47'> <metadata fileref='images/a.jpg'> <tag name='Keywords'>a</tag> <tag name='Keywords'>b</tag> </metadata> </metadatas>

exiftool a.jpg -keywords -X -l -g1
<?xml version='1.0' encoding='UTF-8'?> <metadatas toolkit='Image::ExifTool 7.47'> <metadata fileref='images/a.jpg'> <group name='IPTC' family='1'> <tag> <name>Keywords</name> <value>a</value> <value>b</value> </tag> </group> </metadata> </metadatas>

exiftool images/a.jpg images/b.jpg -filename -keywords -X -g
<?xml version='1.0' encoding='UTF-8'?> <metadatas toolkit='Image::ExifTool 7.47'> <metadata fileref='a.jpg'> <group name='File' family='0'> <tag name='FileName'>images/a.jpg</tag> </group> <group name='IPTC' family='0'> <tag name='Keywords'>a</tag> <tag name='Keywords'>b</tag> </group> </metadata> <metadata fileref='images/b.jpg'> <group name='File' family='0'> <tag name='FileName'>b.jpg</tag> </group> <group name='IPTC' family='0'> <tag name='Keywords'>one</tag> </group> </metadata> </metadatas>

The container for file seems logical since individual file info has to be grouped under some element.

List-type tags seem alright to me. I think list items look fine on the same node level as other elements, without any preference given to the order of individual list elements. Maybe an attribute could be added for such elements like list='true'.
Actually, I am a little doubtful about the very short format. I was wondering whether a single keyword can contain commas? Maybe a keyword like "Virginia, Illinois" (since there's also "Virginia, SomeOtherPlace")... If so, then such a keyword will break into 2 keywords, in the very short output format. And list-items can't be put into 2 attributes, since duplicate attributes are not allowed, again atleast according to W3C specs. But I think it should be okay for the very short format. ...In the current tab-delimited and HTML output also, it seems fine to separate them by commas. But for XML (apart from very short format), I think they should be separated in list format.

Well ... ... this is my/one viewpoint.

And yes, the options are quite overwhelming... :-)... but are sure worth it!

- Kailash
Direct Responses: 8966 | 8964 | Write a response