MCPcopy Create free account
hub / github.com/apache/freemarker / removePIs

Method removePIs

src/main/java/freemarker/ext/dom/NodeModel.java:419–437  ·  view source on GitHub ↗

Recursively removes all processing instruction nodes from the subtree. @see #simplify

(Node node)

Source from the content-addressed store, hash-verified

417 * @see #simplify
418 */
419 static public void removePIs(Node node) {
420 NodeList children = node.getChildNodes();
421 int i = 0;
422 int len = children.getLength();
423 while (i < len) {
424 Node child = children.item(i);
425 if (child.hasChildNodes()) {
426 removePIs(child);
427 i++;
428 } else {
429 if (child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
430 node.removeChild(child);
431 len--;
432 } else {
433 i++;
434 }
435 }
436 }
437 }
438
439 /**
440 * Merges adjacent text/cdata nodes, so that there are no

Callers 1

parseMethod · 0.95

Calls 2

getChildNodesMethod · 0.65
getNodeTypeMethod · 0.65

Tested by

no test coverage detected