From 9bf766f6195b67bb79127d3855ac110a195cf21d Mon Sep 17 00:00:00 2001 From: Ulisses Lima Date: Mon, 4 Dec 2023 11:37:09 -0300 Subject: [PATCH] BAEL ???? - Intro to XPath with Java - quick fix Based on email feedback. * Changing `childs` to `childNodes` * Changing `nodeList = (NodeList)` to `NodeList nodeList = (NodeList)` --- xml/src/main/java/com/baeldung/xml/DefaultParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/src/main/java/com/baeldung/xml/DefaultParser.java b/xml/src/main/java/com/baeldung/xml/DefaultParser.java index 83280aa0f2..63e4a453c3 100644 --- a/xml/src/main/java/com/baeldung/xml/DefaultParser.java +++ b/xml/src/main/java/com/baeldung/xml/DefaultParser.java @@ -163,10 +163,10 @@ public class DefaultParser { private void clean(Node node) { - NodeList childs = node.getChildNodes(); + NodeList childNodes = node.getChildNodes(); - for (int n = childs.getLength() - 1; n >= 0; n--) { - Node child = childs.item(n); + for (int n = childNodes.getLength() - 1; n >= 0; n--) { + Node child = childNodes.item(n); short nodeType = child.getNodeType(); if (nodeType == Node.ELEMENT_NODE)