Daniel Nixon wrote:
I want to write a beagle filter for xmltv files, but the problem I see is that xmltv files simply have the .xml extension and the application/xml mimetype. Is there a way to write an xml filter that only supports a particular DTD?
I'm not sure this is the right approach (I looked into XMLTV support before).
Generally with XMLTV, the data files are kept in a single private directory which belongs to a program, rather than scattered around the filesystem.
This is comparable to evolution mail which keeps mails in ~/.evolution, in contrast to documents which are found anywhere and everywhere on the filesystem.
In the first case (email), you want to add support for the *application*. We have an evolution backend for this.
In the second case (documents), you want to add support for the *format*. We have (e.g.) openoffice filters for this, and the filesystem backend does the other dirty work.
Unless I'm mistaken (I'm not an xmltv user), you want to support the application here. Your general game plan would look like:
1. Find the application config file 2. Parse the store location from the config file3. Enumerate all files in the config file, passing them to the appropriate filter
An example of this is the Gaim log filter. The Gaim logs aren't in any special format, they don't have their own mimetype, but they do have a special storage location. The GaimLog backend finds them, and enforces that they are filtered using the ImLog filter.
Displaying xmltv search results is one thing, but you also need to consider how you are going to act on them when the user clicks on the search results. This was the major showstopper when I was looking into this - there didn't appear to be any standard application which would allow Beagle to say "display the file foo.xml" or "display the program at 8pm on Tuesday".
Daniel