// construct a list of attributes, needed for CTA processing. This includes
// inherited attributes as well.
private XMLAttributes getAttributesForCTA(XMLAttributes attributes) {
// copy attributes from the original list of attributes
XMLAttributes ctaAttributes = new XMLAttributesImpl();
for (int attrIndx = 0; attrIndx < attributes.getLength(); attrIndx++) {
QName qName = new QName();
attributes.getName(attrIndx, qName);
ctaAttributes.addAttribute(qName, attributes.getType(attrIndx),
attributes.getValue(attrIndx));
}
// traverse up the XML tree, to find inherited attributes.
// attributes only from the nearest ancestor, are added to the list
for (int elemIndx = fInheritableAttrList.size() - 1; elemIndx > -1; elemIndx--) {
InheritableAttribute inhAttr = (InheritableAttribute) fInheritableAttrList.elementAt(elemIndx);
// if an inheritable attribute doesn't already exist, in the attributes
// list, add it to the list.
if (!attributeExists(ctaAttributes, inhAttr)) {
String rawName = "".equals(inhAttr.getPrefix()) ? inhAttr.getLocalName() :
inhAttr.getPrefix() + ":" + inhAttr.getLocalName();
fTempQName.setValues(inhAttr.getPrefix(), inhAttr.getLocalName(), rawName, inhAttr.getUri());
ctaAttributes.addAttribute(fTempQName, inhAttr.getType(), inhAttr.getValue());
}
}
return ctaAttributes;