DOMSource getNode - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for DOMSource getNode method.

This code example shows how to use the following methods:getNode
        DOMSource response = dispatcher.invoke(request);
        return response;
    } 
 
    private String transformResponseToMessage(DOMSource response) throws Exception {
        Document document = (Document) response.getNode();
        XPath xpath = XPathFactory.newInstance().newXPath();
        XPathExpression expression = xpath.compile("//return/text()");
        String result = (String) expression.evaluate(document, XPathConstants.STRING);
        return result;
    } 
} 
5
CodeRank
This code example shows how to use the following methods:getNode
        } 
        return names;
    } 
 
    public static Set<Node> getRootNodes(DOMSource request) {
        return populateNodes(request.getNode(), new HashSet<Node>());
    } 
 
    public static Set<Node> populateNodes(Node node, Set<Node> nodes) {
        if (node != null) {
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                nodes.add(node);
            } 
            populateNodes(node.getNextSibling(), nodes);
        } 
        return nodes;
    } 
 
    public static QName nodeToQName(Node node) {
        return new QName(node.getNamespaceURI(), node.getLocalName());
5
CodeRank
This code example shows how to use the following methods:getNode
public class SimpleEchoResponder { 
 
	public Source issueResponseFor(DOMSource request) {
		return new DomSourceFactory().createSource( 
				"<echoResponse xmlns=\"http://www.springframework.org/spring-ws/samples/echo\">" + 
				request.getNode().getTextContent() + "</echoResponse>");
	} 
} 
5
CodeRank
This code example shows how to use the following methods:setString
	@Override 
	public SqlXmlValue newSqlXmlValue(final String value) {
		return new AbstractJdbc4SqlXmlValue() { 
			@Override 
			protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
				xmlObject.setString(value);
			} 
		}; 
	} 
 
	@Override 
	public SqlXmlValue newSqlXmlValue(final XmlBinaryStreamProvider provider) {
		return new AbstractJdbc4SqlXmlValue() { 
			@Override 
			protected void provideXml(SQLXML xmlObject) throws SQLException, IOException {
				provider.provideXml(xmlObject.setBinaryStream());
			} 
		}; 
	} 
 
6
CodeRank
This code example shows how to use the following methods:getSource, getString
            tf.setOutputProperty(OutputKeys.STANDALONE, "yes");//$NON-NLS-1$
            tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
 
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            StreamResult xmlOut = new StreamResult(new BufferedOutputStream(out));
            tf.transform(xml.getSource(StreamSource.class), xmlOut);
 
            return out.toString();
        } catch (Exception e) {
            return xml.getString();
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:getSource, getString
			tf.setOutputProperty(OutputKeys.STANDALONE, "yes");//$NON-NLS-1$
			tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
			 
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			StreamResult xmlOut = new StreamResult(new BufferedOutputStream(out));
			tf.transform(xml.getSource(StreamSource.class), xmlOut);
			 
			return out.toString();
		} catch (Exception e) {
			return xml.getString();
		} 
	}    
} 
4
CodeRank
This code example shows how to use the following methods:getString
        } 
        else if (paramValue instanceof SQLXML)
        { 
            SQLXML sqlxml = (SQLXML) paramValue;
 
            paramValue = sqlxml.getString();
        } 
 
        return new OutputParamResult(outputSqlParam.getName(), paramValue);
    } 
 
    protected StatementResult doProcessUpdateCount(String name, int value)
    { 
        return new UpdateCountResult(name, value);
    } 
 
    private StatementResult processResultSet() 
    { 
        StatementResult result;
 
4
CodeRank
This code example shows how to use the following methods:free
	} 
 
	@Override 
	public void close(D database, SQLXML xml) throws SQLExceptionxml.free();
	} 
 
	@Override 
	public SQLXML createProxy()
	{ 
		return Proxies.createProxy(SQLXML.class, new SQLXMLInvocationHandler<>(this));
	} 
} 
4
CodeRank
This code example shows how to use the following methods:getSource
 
	private StAXSource convertToSource(SQLXML xml) throws SQLException {
		if (xml == null) {
			return null; 
		} 
		return xml.getSource(StAXSource.class);
	} 
     
    @Override 
    public List<?> next() throws TranslatorException, DataNotAvailableException {
    	return null; 
    }   
     
    @Override 
    public List<?> getOutputParameterValues() throws TranslatorException {
    	Object result = returnValue;
		if (returnValue != null && procedure.getArguments().size() > 4
				&& procedure.getArguments().get(4).getDirection() == Direction.IN
				&& Boolean.TRUE.equals(procedure.getArguments().get(4).getArgumentValue().getValue())) {
			SQLXMLImpl sqlXml = new StAXSQLXML(returnValue);
4
CodeRank
This code example shows how to use the following methods:getString
                     "</customer>"; //$NON-NLS-1$ 
         
       StringToSQLXMLTransform transform = new StringToSQLXMLTransform();
        
       SQLXML xmlValue = (SQLXML)transform.transformDirect(xml);
       assertEquals(xml.replaceAll("[\r]", ""), xmlValue.getString().replaceAll("[\r]", ""));
    } 
	 
	@Test public void testGoodElement() throws Exception {
        String xml = "<customer>\n" + //$NON-NLS-1$
                        "<name>ABC</name>" + //$NON-NLS-1$ 
                        "<age>32</age>" + //$NON-NLS-1$ 
                     "</customer>"; //$NON-NLS-1$ 
         
       StringToSQLXMLTransform transform = new StringToSQLXMLTransform();
        
       XMLType xmlValue = (XMLType)transform.transformDirect(xml);
       assertEquals(xml.replaceAll("[\r]", ""), xmlValue.getString().replaceAll("[\r]", ""));
       assertEquals(XMLType.Type.ELEMENT, xmlValue.getType());
    } 
4
CodeRank
getNode Method Overview
Get the node that represents a Source DOM tree.
See Code Examples for other Java 8 DOMSource Methods: