[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perl modules !?



I know this reply is probably too late, but it seems nobody
returned any response...So here's mine (I subscribed this list
just now).

> Short time ago I started implementing a family tree management program
> with Perl (on Linux). Now I had the idea, that it would be quite cool to
> add some nice export filters for standardized formats to provide the
> collected data to other applications.

I had recently finished implementation of DOM-like interface for
N-tree structure (to handle iCalendar format). I thought of
almost the same idea, and had implemented two methods: printLikeXML
and printLikeRFC2425. I had also finished simple, non-validating
iCalendar (or RFC2425) format parser.

Although XML (which its interface is defined by DOM spec) and
RFC2425 are somewhat incompatible (especially for "valuespec"
part), it was very useful to have a library which let programmer
read RFC2425 format, handle it through DOM interface, and then
export it back in either XML or RFC2425.

# Writing generic XML-to-DOM-to-RFC2425 converter seems
# to be hard unless you can be very application specific.

Since there's XML::DOM already available from CPAN, what you need
is to write a parser which returns XML::DOM(::Document) object as
a result. Once done, it's a trivial task to write DOM-to-XML or
DOM-to-RFC2425 converter. If you want interface specific for your
family-tree library, just create subclass of XML::DOM::Document
and add one.

Hope this helps for your parser/exporter implementation.

# Sorry I can't just open up my implementation, but it's
# closed-source and can't do anything about it.

--
T. Yamada <tai@xxxxxxxxxxx>
PGP fingerprint = 6B 57 1B ED 65 4C 7D AE  57 1B 49 A7 F7 C8 23 46