Java Utililty Methods XML Element Print

List of utility methods to do XML Element Print

Description

The list of methods to do XML Element Print are organized into topic(s).

Method

voidprintElement(Element e)
Utility method for displaying an Element
printElement(e, "");
voidprintElement(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);
voidprintElementBody(Element elem, StringWriter sw)
Print a single element node
Node child = elem.getFirstChild();
while (child != null) {
    printNode(child, sw);
    child = child.getNextSibling();
voidprintElementEnd(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(">");
voidprintElementStart(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("=\"");
...
voidprintElemShallow(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());
...
intprintMethodArgs(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();
...