/** * Prints information - most technical - of the xml element and its childs to the stream. * * @param o * @param element */ public static void dump(PrintStream o, Node element) { dump(o, element, ""); }
public static void dump(PrintStream out, NodeList nodes) { for (int i = 0; i < nodes.getLength(); i++) dump(out, nodes.item(i), ""); }
/** * Prints information - most technical - of the xml element and its childs and returns it as string. * Use this function for debugging (debugger). * * @param element * @return a dump representation */ public static String dump(Node element) { if (element == null) return "null"; ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintStream o = new PrintStream(out); dump(o, element, ""); return out.toString(); }