{
Logger logger = Logger.getLogger(SBMLReader.class);
ReadingParser namespaceParser = null;
while (nam.hasNext()) {
Namespace namespace = (Namespace) nam.next();
boolean isLastNamespace = !nam.hasNext();
namespaceParser = initializedParsers.get(namespace.getNamespaceURI());
logger.debug("processNamespaces: " + namespace.getNamespaceURI());
// Calling the currentNode parser to store all the declared namespaces
parser.processNamespace(currentNode.getLocalPart(),
namespace.getNamespaceURI(),
namespace.getName().getPrefix(),
namespace.getName().getLocalPart(),
hasAttributes, isLastNamespace,
sbmlElements.peek());
// Calling each corresponding parser, in case they want to initialize things for the currentNode
if ((namespaceParser != null) && !namespaceParser.getClass().equals(parser.getClass())) {
logger.debug("processNamespaces 2e parser: " + namespaceParser);
namespaceParser.processNamespace(currentNode.getLocalPart(),
namespace.getNamespaceURI(),
namespace.getName().getPrefix(),
namespace.getName().getLocalPart(),
hasAttributes, isLastNamespace,
sbmlElements.peek());
} else if (namespaceParser == null) {
logger.warn(MessageFormat.format("Cannot find a parser for the {0} namespace", namespace.getNamespaceURI()));
}
}
}