Creates a new DOM node instance for the input node. @param node input node @return DOM node, or null if input is no XML node
(final GNode node)
| 45 | * @return DOM node, or {@code null} if input is no XML node |
| 46 | */ |
| 47 | public static BXNode get(final GNode node) { |
| 48 | return node instanceof final XNode xnode ? switch(node.kind()) { |
| 49 | case DOCUMENT -> new BXDoc(xnode); |
| 50 | case ELEMENT -> new BXElem(xnode); |
| 51 | case TEXT -> new BXText(xnode); |
| 52 | case COMMENT -> new BXComm(xnode); |
| 53 | case PROCESSING_INSTRUCTION -> new BXPI(xnode); |
| 54 | case ATTRIBUTE -> new BXAttr(new FAttr(xnode.qname(), xnode.string())); |
| 55 | default -> null; |
| 56 | } : null; |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public String getNodeName() { |