Best Practice Makes Perfect

At Lotusphere I demoed an application to read XML files and report a summary of their contents; the files in question are the "palette" files created by the Notes 8 Composite Application Editor tool. Like many XML files, this one has its quirks -- some attribute values in it are double-encoded, so that e.g. "

The interesting code is in the script library "Class CAEPalette", which is called from the (Display My Palette) agent. As the name suggests, the agent isn't making any modifications to the palette -- just pulling information from it -- but the methods to extract and insert chunks of XML are in the library. In particular, you might look at the CopyTree function, and the InsertXML function which calls it; these are generally useful in cases where you're combining XML from multiple sources. If they aren't all children of the same DOMDocument, you can't simply call AppendChild or Clone.

Here's the application:

A reminder: before version 7.0.3 / 8.0.1, the LotusScript DOM parser didn't correctly handle apostrophes in attribute values when serializing. This may have some effect on this code, depending on the data in your palette files.