/** * Replace a node with another one. * * @param oldNode * old node * @param newNode * new node * @return the old node that is detached */ public static OMNode replaceNode(OMNode oldNode, OMNode newNode) { oldNode.insertSiblingAfter(newNode); return oldNode.detach(); }
/** * Replace a node with another one. * * @param oldNode * old node * @param newNode * new node * @return the old node that is detached */ public static OMNode replaceNode(OMNode oldNode, OMNode newNode) { oldNode.insertSiblingAfter(newNode); return oldNode.detach(); }
om.detach(); prevSib.insertSiblingAfter( newEl );
public boolean mediate(MessageContext synCtx) { SynapseLog synLog = getLog(synCtx); OMNode replacement = (OMNode)synCtx.getProperty(property); OMNode node = target.selectOMNode(synCtx, synLog); node.insertSiblingAfter(replacement); node.detach(); synCtx.setProperty(property, null); return true; }
static void processExpressions(ITag tag, IParserContext context) { if (!(tag instanceof ExpressionTag)) { // make sure all text nodes are converted to <expression> tags OMElement ele = context.getElement(); for (OMNode child : AxiomUtils.getNodes(ele)) { if (child.getType() == OMNode.TEXT_NODE) { OMText textNode = (OMText) child; String text = textNode.getText(); if (StringUtils.isNotBlank(text)) { OMElement expTag = createExpressionTag(text, ele.getLineNumber()); child.insertSiblingAfter(expTag); child.detach(); } } } } }
static void processExpressions(ITag tag, IParserContext context) { if (!(tag instanceof ExpressionTag)) { // make sure all text nodes are converted to <expression> tags OMElement ele = context.getElement(); for (OMNode child : AxiomUtils.getNodes(ele)) { if (child.getType() == OMNode.TEXT_NODE) { OMText textNode = (OMText) child; String text = textNode.getText(); if (StringUtils.isNotBlank(text)) { OMElement expTag = createExpressionTag(text, ele.getLineNumber()); child.insertSiblingAfter(expTag); child.detach(); } } } } }
((OMNode) o).detach(); } else if (resultValue instanceof OMNode) { ((OMNode) o).insertSiblingAfter((OMNode) resultValue); ((OMNode) o).detach();
((OMNode) o).detach(); } else if (resultValue instanceof OMNode) { ((OMNode) o).insertSiblingAfter((OMNode) resultValue); ((OMNode) o).detach();
sourceNode.insertSiblingAfter(result); sourceNode.detach();
sourceNode.insertSiblingAfter(result); sourceNode.detach();
destination.insertSiblingAfter(resultOM); destination.detach();
if (resultOM != null) { destination.insertSiblingAfter(resultOM); destination.detach();
if (o != null && o instanceof OMElement) { OMNode tgtNode = (OMElement) o; tgtNode.insertSiblingAfter(result); tgtNode.detach(); } else if (o != null && o instanceof List && !((List) o).isEmpty()) { tgtNode.insertSiblingAfter(result); tgtNode.detach(); } else {
tgtNode.insertSiblingAfter(result); tgtNode.detach(); } else if (o != null && o instanceof List && !((List) o).isEmpty()) { tgtNode.insertSiblingAfter(result); tgtNode.detach(); } else {
if (o != null && o instanceof OMElement) { OMNode tgtNode = (OMElement) o; tgtNode.insertSiblingAfter(result); tgtNode.detach(); } else if (o != null && o instanceof List && !((List) o).isEmpty()) { tgtNode.insertSiblingAfter(result); tgtNode.detach(); } else {