protected void setChild(Element element, boolean append) { if (currentNode != null) { stack.push(currentNode); if (append) { currentNode.appendChild(element); } } else { if (append) { document.appendChild(element); } } if (!(context instanceof W3CNamespaceContext)) { // set the outside namespace context W3CNamespaceContext childContext = new W3CNamespaceContext(); childContext.setOutNamespaceContext(context); context = childContext; } ((W3CNamespaceContext)context).setElement(element); currentNode = element; }
public String getNamespaceURI(String prefix) { String name = prefix; if (name.length() == 0) { name = "xmlns"; } else { name = "xmlns:" + prefix; } return getNamespaceURI(currentNode, name); }
public String getPrefix(String uri) { return getPrefix(currentNode, uri); }
protected void setChild(Element element, boolean append) { if (currentNode != null) { stack.push(currentNode); if (append) { currentNode.appendChild(element); } } else { if (append) { document.appendChild(element); } } if (!(context instanceof W3CNamespaceContext)) { context = new W3CNamespaceContext(); } ((W3CNamespaceContext)context).setElement(element); currentNode = element; }
public W3CDOMStreamWriter(Document owner, Element e) { this.document = owner; currentNode = e; ((W3CNamespaceContext)context).setElement(e); }
p.setNamespaceContext(new W3CNamespaceContext(d.getDocumentElement())); XPathExpression xpe = p.compile(d.getDocumentElement().getAttribute("node")); for (XmlSchema schema : schemas.getXmlSchemas()) {
@Override public String getPrefix(String nsuri) throws XMLStreamException { if (isOverlaid && part != null && getCurrentNode() == null) { Node nd = part.getFirstChild(); while (nd != null) { if (nd instanceof Element) { Iterator<String> it = new W3CNamespaceContext((Element)nd).getPrefixes(nsuri); if (it.hasNext()) { return it.next(); } nd = null; } else { nd = nd.getNextSibling(); } } } return super.getPrefix(nsuri); } private String getEnvelopeURI() throws SOAPException {
context = new W3CNamespaceContext(); context.setElement((Element)element);
public W3CDOMStreamWriter(Document owner, Element e) { this.document = owner; currentNode = e; ((W3CNamespaceContext)context).setElement(e); }
p.setNamespaceContext(new W3CNamespaceContext(d.getDocumentElement())); XPathExpression xpe = p.compile(d.getDocumentElement().getAttribute("node")); for (XmlSchema schema : schemas.getXmlSchemas()) {
@Override public String getPrefix(String nsuri) throws XMLStreamException { if (isOverlaid && part != null && getCurrentNode() == null) { Node nd = part.getFirstChild(); while (nd != null) { if (nd instanceof Element) { Iterator<String> it = new W3CNamespaceContext((Element)nd).getPrefixes(nsuri); if (it.hasNext()) { return it.next(); } nd = null; } else { nd = nd.getNextSibling(); } } } return super.getPrefix(nsuri); } private String getEnvelopeURI() throws SOAPException {
protected void setChild(Element element, boolean append) { if (currentNode != null) { stack.push(currentNode); if (append) { currentNode.appendChild(element); } } else { if (append) { document.appendChild(element); } } if (!(context instanceof W3CNamespaceContext)) { // set the outside namespace context W3CNamespaceContext childContext = new W3CNamespaceContext(); childContext.setOutNamespaceContext(context); context = childContext; } ((W3CNamespaceContext)context).setElement(element); currentNode = element; }
context = new W3CNamespaceContext(); context.setElement((Element)element);
public W3CDOMStreamWriter(Document owner, Element e) { this.document = owner; currentNode = e; ((W3CNamespaceContext)context).setElement(e); }
public String getPrefix(String uri) { return getPrefix(currentNode, uri); }
public String getNamespaceURI(String prefix) { String name = prefix; if (name.length() == 0) { name = "xmlns"; } else { name = "xmlns:" + prefix; } return getNamespaceURI(currentNode, name); }
@Test public void testDispatchClient() throws Exception { SOAPServiceRPCLit service = new SOAPServiceRPCLit(); Dispatch<Source> disp = service.createDispatch(portName, Source.class, javax.xml.ws.Service.Mode.PAYLOAD); updateAddressPort(disp, PORT); String req = "<ns1:sendReceiveData xmlns:ns1=\"http://apache.org/hello_world_rpclit\">" + "<in xmlns:ns2=\"http://apache.org/hello_world_rpclit/types\">" + "<ns2:elem1>elem1</ns2:elem1><ns2:elem2>elem2</ns2:elem2><ns2:elem3>45</ns2:elem3>" + "</in></ns1:sendReceiveData>"; Source source = new StreamSource(new StringReader(req)); Source resp = disp.invoke(source); assertNotNull(resp); Node nd = StaxUtils.read(resp); if (nd instanceof Document) { nd = ((Document)nd).getDocumentElement(); } XPathUtils xpu = new XPathUtils(new W3CNamespaceContext((Element)nd)); assertTrue(xpu.isExist("/ns1:sendReceiveDataResponse/out", nd, XPathConstants.NODE)); } @Test
protected void setChild(Element element, boolean append) { Node appendedChildNode = null; if (currentNode != null) { stack.push(currentNode); if (append) { appendedChildNode = currentNode.appendChild(element); } } else { if (append) { appendedChildNode = document.appendChild(element); } } if (!(context instanceof W3CNamespaceContext)) { // set the outside namespace context W3CNamespaceContext childContext = new W3CNamespaceContext(); childContext.setOutNamespaceContext(context); context = childContext; } ((W3CNamespaceContext)context).setElement(element); if (appendedChildNode != null) { currentNode = org.apache.cxf.helpers.DOMUtils.getDomElement(appendedChildNode); } else { currentNode = element; } }
context = new W3CNamespaceContext(); context.setElement((Element)element);
public W3CDOMStreamWriter(Document owner, Element e) { this.document = owner; currentNode = e; ((W3CNamespaceContext)context).setElement(e); }