Web / Apache Axiom Interview questions
What is OMNamespace in Axiom?
OMNamespace is Axiom's representation of an XML namespace declaration - a pairing of a namespace URI and the prefix used to reference it within a given scope.
It's created through a factory, e.g. factory.createOMNamespace("http://example.com/ns", "ex"), and then attached to elements or attributes so their qualified names resolve correctly on serialization.
Axiom tracks namespace scope the same way XML itself does: a namespace declared on a parent element is inherited by its descendants unless overridden, and Axiom's serializer avoids redundantly re-declaring an already-in-scope namespace when writing the tree back out, keeping generated XML compact.
Passing an empty string as the prefix creates the default namespace for that scope, while passing null for both URI and prefix is how you represent "no namespace" on an element or attribute.
More Related questions...