use of org.apache.axiom.core.CoreNamespaceDeclaration in project webservices-axiom by apache.
the class NamespaceContextPreservationFilterHandler method attributesCompleted.
@Override
public void attributesCompleted() throws StreamException {
if (!done) {
try {
CoreElement current = contextElement;
while (true) {
CoreAttribute attr = current.coreGetFirstAttribute();
while (attr != null) {
if (attr instanceof CoreNamespaceDeclaration) {
CoreNamespaceDeclaration decl = (CoreNamespaceDeclaration) attr;
String prefix = decl.coreGetDeclaredPrefix();
if (prefixesAlreadyBound.add(prefix)) {
super.processNamespaceDeclaration(prefix, decl.coreGetCharacterData().toString());
}
}
attr = attr.coreGetNextAttribute();
}
CoreParentNode parent = current.coreGetParent();
if (!(parent instanceof CoreElement)) {
break;
}
current = (CoreElement) parent;
}
prefixesAlreadyBound = null;
done = true;
} catch (CoreModelException ex) {
throw new StreamException(ex);
}
}
super.attributesCompleted();
}
use of org.apache.axiom.core.CoreNamespaceDeclaration in project webservices-axiom by apache.
the class BuildableContext method processNamespaceDeclaration.
@Override
void processNamespaceDeclaration(String prefix, String namespaceURI) throws StreamException {
if (passThroughHandler != null) {
passThroughHandler.processNamespaceDeclaration(prefix, namespaceURI);
} else {
CoreNamespaceDeclaration decl = builderHandler.nodeFactory.createNode(CoreNamespaceDeclaration.class);
decl.init(prefix, namespaceURI, builderHandler.namespaceHelper);
((CoreElement) target).coreAppendAttribute(decl);
}
}
Aggregations