Web / Apache Axiom Interview questions
What are the types of OMNode in Axiom?
OMNode is the base type for anything that can appear in Axiom's tree, and it defines a small set of node-type constants mirroring the kinds of content XML can contain.
| Node type | Represented by |
| Element | OMElement |
| Text / CDATA | OMText (plain, CDATA, or binary/MTOM) |
| Comment | OMComment |
| Processing instruction | OMProcessingInstruction |
| Document type declaration | OMDocType |
Each concrete interface extends OMNode and adds behavior specific to that kind of content, while shared operations - like detach(), getNextOMSibling(), and getParent() - live on OMNode itself so they work uniformly across every node type.
Checking a node's type at runtime is typically done via getType() against the constants defined on OMNode, when code needs to branch on what kind of content it's looking at.
More Related questions...