As previously mentioned here and here I’m using external entities at present to redue the amount of dublicate data when sharing data among XML documents. A better choice than entities would be to use XInclude which is a recommendation from W3C on how to include XML documents in other XML documents. The difference betwwen entities and XInclude is that XInclue is an extension to the core XML and that it integrates nicely with the other XML extensions such as XSLT. An example of using XInclude is show below:
<code> <xi:include href="MyFile.xml" /> </code>
Unfortunately XInclude isn’t supported in the LotusScript XML classes – probably because it’s only a recommendation. It isn’t supported in the Java included in Notes/Domino either since Notes 7 has Java 1.4.x which in turn has JAXP 1.2 (Java API for XML Processing) which is too old. XInclude is however included in JAXP 1.3 so if you need it you can upgrade your XML processing libraries to the latest Xerces from Apache.
A caveat might be however that Notes/Domino is shipped with a combined Xalan (XSLT) and Xerces (XML parser) library (/jvm/lib/xml.jar). I haven’t tried updating this library but would like to hear from people having tried. An alternative is off cause to include the new xerces.jar in the agent or similar so the new classes are used.
Resources:
- An article on XInclude at developerWorks: XInclude in JAXP 1.3
- XML.com: Using XInclude