attrs.setAttributes(attributes); // copy the existing ones.
int typeIndex = -1;
if ((typeIndex = attrs.getIndex(Constants.URI_DEFAULT_SCHEMA_XSI, "type")) != -1) {
// Found a xsi:type which should not be there for attachments.
attrs.removeAttribute(typeIndex);
}
attrs.addAttribute("", soapConstants.getAttrHref(), soapConstants.getAttrHref(), "CDATA",
attachmentPart.getContentIdRef());
context.startElement(name, attrs);