Example usage for javax.xml.soap SOAPElement getOwnerDocument

List of usage examples for javax.xml.soap SOAPElement getOwnerDocument

Introduction

In this page you can find the example usage for javax.xml.soap SOAPElement getOwnerDocument.

Prototype

public Document getOwnerDocument();

Source Link

Document

The Document object associated with this node.

Usage

From source file:com.googlecode.ddom.frontend.saaj.SOAPElementTest.java

@Validated
@Test/*from   w  w w  .  j a  v a2  s  .  c o  m*/
public void testGetValueSingleElementChild() throws Exception {
    SOAPElement element = saajUtil.createSOAPElement(null, "test", null);
    element.appendChild(element.getOwnerDocument().createElementNS("urn:ns", "p:child"));
    assertNull(element.getValue());
}

From source file:com.googlecode.ddom.frontend.saaj.SOAPElementTest.java

@Validated
@Test// w ww.  j a  v a2 s . c o  m
public void testGetValueMixedContent2() throws Exception {
    SOAPElement element = saajUtil.createSOAPElement(null, "test", null);
    element.appendChild(element.getOwnerDocument().createElementNS("urn:ns", "p:child1"));
    element.addTextNode("foo");
    element.appendChild(element.getOwnerDocument().createElementNS("urn:ns", "p:child2"));
    element.addTextNode("bar");
    assertEquals("foo", element.getValue());
}

From source file:com.googlecode.ddom.frontend.saaj.SOAPElementTest.java

@Validated
@Test/*w  w w  .j  ava 2 s.co  m*/
public void testGetValueMixedContent1() throws Exception {
    SOAPElement element = saajUtil.createSOAPElement(null, "test", null);
    element.addTextNode("foo");
    element.appendChild(element.getOwnerDocument().createElementNS("urn:ns", "p:child"));
    element.addTextNode("bar");
    assertEquals("foo", element.getValue());
}