ele.setAttribute(ICSSPropertyID.ATTR_PREFIX, prefix);
if (nodes != null && nodes.length > 0) {
nodes[0] = ele;
}
model.getDocument().insertBefore(ele, ref[0]);
new HTMLFormatProcessorImpl().formatNode(ele);
}
else {//xml format
//find root element
boolean tldRefExists = false;
Element root = getRootElement(model);
if (root != null){
NamedNodeMap attrs = root.getAttributes();
for (int i=0;i<attrs.getLength();i++){
Attr a = (Attr)attrs.item(i);
//is the taglib uri already declared?
if (a.getValue().equals(uri)){
tldRefExists = true;
break;
}
}
if (!tldRefExists){
//create attribute
Attr a = model.getDocument().createAttribute("xmlns:"+prefix); //$NON-NLS-1$
a.setValue(uri);
root.setAttributeNode(a);
new HTMLFormatProcessorImpl().formatNode(root);
//duplicating what non-xml case does... no callerd making use of this currently
if (nodes != null && nodes.length > 0) {
nodes[0] = a;
}