List of utility methods to do XML Element Print
void | printElement(Element e) Utility method for displaying an Element printElement(e, "");
|
void | printElement(SOAPElement el) recursively print element System.out.println(el.getElementName() + el.getValue()); Iterator itAtt = el.getAllAttributes(); if (itAtt.hasNext()) { System.out.print("<" + el.getElementName()); while (itAtt.hasNext()) { SOAPElement att = (SOAPElement) itAtt.next(); System.out.print(" " + att.getElementName() + "=" + att.getValue()); System.out.println(">"); } else { System.out.println("<" + el.getElementName() + ">"); System.out.println(el.getValue()); System.out.println("</" + el.getElementName() + ">"); Iterator it = el.getChildElements(); while (it.hasNext()) { SOAPElement element = (SOAPElement) it.next(); printElement(element); |
void | printElementBody(Element elem, StringWriter sw) Print a single element node Node child = elem.getFirstChild();
while (child != null) {
printNode(child, sw);
child = child.getNextSibling();
|
void | printElementEnd(Element elem, StringWriter sw) Print an element's end-code to the current buffer if (elem.getFirstChild() != null) { sw.write("</"); sw.write(elem.getNodeName()); sw.write(">"); |
void | printElementStart(Element elem, StringWriter sw) Print a single element node to the current buffer sw.write("<"); sw.write(elem.getNodeName()); NamedNodeMap attrs = elem.getAttributes(); for (int j = 0; j < attrs.getLength(); j++) { Node attr = attrs.item(j); sw.write(" "); sw.write(attr.getNodeName()); sw.write("=\""); ... |
void | printElemShallow(Element elem, String endient, PrintStream pstrm) print Elem Shallow if (elem == null) { return; String tag = elem.getTagName(); if (tag.equals("bean") == false && tag.equals("ioc") == false) { return; pstrm.print(endient + "<" + elem.getTagName()); ... |
int | printMethodArgs(Element elem, String endient, PrintStream pstrm) print Method Args endient += ELEM_ENDIENT; int count = 0; NodeList nodes = elem.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node instanceof Element) { Element child = (Element) node; String tag = child.getTagName(); ... |