List of usage examples for javax.xml.soap Text getValue
public String getValue();
From source file:com.googlecode.ddom.frontend.saaj.SOAPElementTest.java
@Validated @Test/*w w w .j a va 2 s . c o m*/ public void testSetValueSingleTextChild() throws Exception { SOAPElement element = saajUtil.createSOAPElement(null, "test", null); element.addTextNode("initial content"); Text text = (Text) element.getFirstChild(); String value = "new value"; element.setValue(value); assertEquals(value, text.getValue()); }
From source file:org.jbpm.bpel.integration.soap.SoapUtil.java
public static void copyChildNodes(Element target, SOAPElement source) { // easy way out: no child nodes to copy if (!source.hasChildNodes()) return;//w ww. j av a 2s. co m // traverse child nodes Iterator childIt = source.getChildElements(); while (childIt.hasNext()) { Object child = childIt.next(); if (child instanceof SOAPElement) { copyChildElement(target, (SOAPElement) child); } else if (child instanceof Text) { Text childText = (Text) child; String value = childText.getValue(); target.appendChild(target.getOwnerDocument().createTextNode(value)); if (traceEnabled) log.trace("appended text: " + value); } else log.debug("discarding child: " + child); } }