null);
}
} else {
// We are trying to complete something other than the
// close element markup
ElementDefinition element =
schema.getElementDefinition(elementName);
matchName = localMatchName(matchName,
ic.isAttribute(),
prefix);
// If an element definition cannot be found for the
// containing element, or we can't derive a local match
// name from the input context we can't do completions
if ((element != null) && (matchName != null)) {
List options = new ArrayList();
if (ic.isAttribute()) {
List attributes =
element.getAttributeDefinitions(matchName);
AttributeDefinition attribute;
for (int i = 0;
i < attributes.size();
i++) {
attribute =
(AttributeDefinition)attributes.get(i);
options.add(attribute.getName());
}
} else {
List subElements =
element.getSubElementNames(matchName);
options.addAll(subElements);
}
if (options.size() != 0) {