Here you can find the source of printElement(SOAPElement el)
Parameter | Description |
---|---|
el | a parameter |
static private void printElement(SOAPElement el)
//package com.java2s; /*/*ww w . j a v a 2s . co m*/ * ==================================================================== * This software is subject to the terms of the Common Public License * Agreement, available at the following URL: * http://www.opensource.org/licenses/cpl.html . * Copyright (C) 2003-2004 TONBELLER AG. * All Rights Reserved. * You must accept the terms of that agreement to use this software. * ==================================================================== * * */ import java.util.Iterator; import javax.xml.soap.SOAPElement; public class Main { /** * recursively print element * @param el */ static private void printElement(SOAPElement el) { 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); } } }