From 168e536068ebe86bac9feb83fa9a47d82587db96 Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Fri, 2 Aug 2024 18:40:31 -0500 Subject: [PATCH] fix XML parser self-destructing when it tries to get child elements belonging to a developer comment --- firestar/src/main/java/Rizzo.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/firestar/src/main/java/Rizzo.java b/firestar/src/main/java/Rizzo.java index 64ecf41..599b7eb 100644 --- a/firestar/src/main/java/Rizzo.java +++ b/firestar/src/main/java/Rizzo.java @@ -47,12 +47,8 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.OutputKeys; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; + +import org.w3c.dom.*; import org.xml.sax.SAXException; import org.apache.commons.text.StringEscapeUtils; @@ -353,6 +349,7 @@ public class Rizzo { ns = ((Element)parent).getChildNodes(); for (int i = 0; i < ns.getLength(); i++) { Node n = ns.item(i); + if (n instanceof Comment) continue; if (n.getNodeName().equals("#text")) continue; if (((Element)n).getAttribute("name").equals(name)) { newParent = (Element)n;