/**
* Process <import namespace="" location=""/>
*/
public NamespaceImport read(XMLStreamReader reader) throws ContributionReadException {
NamespaceImport namespaceImport = this.factory.createNamespaceImport();
QName element;
try {
while (reader.hasNext()) {
int event = reader.getEventType();
switch (event) {
case START_ELEMENT:
element = reader.getName();
// Read <import>
if (IMPORT.equals(element)) {
String ns = reader.getAttributeValue(null, NAMESPACE);
if (ns == null) {
error("AttributeNameSpaceMissing", reader);
//throw new ContributionReadException("Attribute 'namespace' is missing");
} else {
namespaceImport.setNamespace(ns);
}
String location = reader.getAttributeValue(null, LOCATION);
if (location != null) {
namespaceImport.setLocation(location);
}
readExtendedAttributes(reader, namespaceImport, attributeProcessor, extensionFactory);
} else {
readExtendedElement(reader, namespaceImport, extensionProcessor);
}