if (dcElement != null) {
MetaDataRegistry registry = null;
try {
registry = (MetaDataRegistry) this.manager.lookup(MetaDataRegistry.ROLE);
ElementSet dcElementSet = registry.getElementSet(DublinCore.DC_NAMESPACE);
ElementSet dcTermSet = registry.getElementSet(DublinCore.DCTERMS_NAMESPACE);
Element[] dcElements = dcHelper.getChildren(dcElement);
for (int i = 0; i < dcElements.length; i++) {
String value = DocumentHelper.getSimpleElementText(dcElements[i]);
String key = dcElements[i].getLocalName();
if (dcElementSet.containsElement(key)) {
List values = getValueList(DublinCore.DC_NAMESPACE, key);
values.add(value);
} else if (dcTermSet.containsElement(key)) {
List values = getValueList(DublinCore.DCTERMS_NAMESPACE, key);
values.add(value);
} else {
throw new RepositoryException("The dublin core key [" + key
+ "] is not supported.");