// get the array version of the nodelist to work around DOM api design.
Node[] nodes = ModelUtil.getArray(contentProviders);
for (int i = 0; i < nodes.length; i++) {
Element contentProviderElement = (Element) nodes[i];
IntroContentProvider provider = new IntroContentProvider(
contentProviderElement, page.getBundle());
provider.setParent(page);
// If we've already loaded the content provider for this element,
// retrieve it, otherwise load the class.
IIntroXHTMLContentProvider providerClass = (IIntroXHTMLContentProvider) ContentProviderManager
.getInst().getContentProvider(provider);
if (providerClass == null)
// content provider never created before, create it.
providerClass = (IIntroXHTMLContentProvider) ContentProviderManager
.getInst().createContentProvider(provider, site);
if (providerClass != null) {
// create a div with the same id as the contentProvider, pass it
// as the parent to create the specialized content, and then
// replace the contentProvider element with this div.
Properties att = new Properties();
att.setProperty(IIntroHTMLConstants.ATTRIBUTE_ID, provider
.getId());
Element contentDiv = ModelUtil.createElement(dom,
ModelUtil.TAG_DIV, att);
providerClass.createContent(provider.getId(), contentDiv);
contentProviderElement.getParentNode().replaceChild(contentDiv,
contentProviderElement);
} else {
// we couldn't load the content provider, so add any alternate