What I did was I wrote a reflective class loader based on SAX. The idea is that with a few hints, XML files, particularly simpler XML files, are self-describing.
Since a majority of XML fields are scalar (number, string, dates), the loader can handle those automatically. It uses the first tag of the XML file to locate the actual class it is loading, and then uses the reflection api to determine the types of the assorted tags. If the tag is a scalar, then the appropriate setter method is called, otherwise it loads up the class and starts over. It turned out to be ~600 lines of code, and with a few simple rules on class design, it works great with essentially no configuration. All it needs to be told is what class the first tag will be, and after that it figures out all the rest. There are no doubt other more generic XML serializers out there, but when it is faster to write the code than it was to learn these other APIs, and the fact that it handles 99% of the tasks we use it for, we're more than pleased with it. I can't share it however. After writing in we discovered that the reflection aspect was happening over and over (when loading large collections), and that it was spectacularly expensive. A quick cache sped it right up though. Regards, Will Hartung ([EMAIL PROTECTED]) -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
