// combination works correctly.
state.setProcessBody(true);
// Get the current name of the attribute that will be used to replace
// the diselect:selid attribute.
ExpandedName selidName = state.getSelidName();
// Check to see whether the element supports a selidname attribute and
// if so whether it is an element specific attribute, of the global
// diselect one.
String selidNameAttributeURI =
diSelectElement.getSelidNameAttributeURI();
if (selidNameAttributeURI != null) {
// Check to see whether there is a selidname attribute, use the
// index as we may need to remove the attribute.
index = attributes.getIndex(selidNameAttributeURI, "selidname");
if (index != -1) {
String value = attributes.getValue(index);
// Only update the attributes if the event is being
// forwarded, otherwise it is a waste of time.
if (forwardEvent) {
// Remove the attribute.
if (output == null) {
output = new AttributesImpl(attributes);
// Use the output attributes as the input to ensure that
// indeces match.
attributes = output;
}
output.removeAttribute(index);
}
// Resolve the value to an ExpandedName, update the value for
// the current element and store it away just in case it is
// needed for descendant elements.
QName qname = new ImmutableQName(value);
selidName = pipelineContext.getNamespacePrefixTracker()
.resolveQName(qname, null);
state.setSelidName(selidName);
}
}
// Only elements outside the diselect namespace support the
// diselect:selid attribute.
if (diSelectElement.canHaveSelidAttribute()) {
// Now check for sel:selid attribute.
index = attributes.getIndex(Constants.DISELECT_NAMESPACE, "selid");
if (index != -1) {
String idURI = selidName.getNamespaceURI();
String idLocalName = selidName.getLocalName();
String idQName;
// Construct the selid attribute's qname, this is dependent on
// the namespace of the selidName and the namespace prefix
// mappings in scope.