Package org.dom4j

Examples of org.dom4j.Document.selectObject()


   
    public static Object xpath(Object object, String xpath) throws DocumentException {
        Object result;
        if (object instanceof String) {
            Document doc = DocumentHelper.parseText((String) object);
            result = doc.selectObject(xpath);
        }
       
        // Do JXPath on Bean
        else {
            if (object instanceof NativeJavaObject) {
View Full Code Here


        Element message = doc.getRootElement();
       
        String text = message.getStringValue();
        assertEquals("String value incorrect", "This should work", text.trim());
       
        String xpathText = (String) doc
                .selectObject("normalize-space(/message)");
        assertEquals("xpath value incorrect", "This should work", xpathText);
    }
   
    public void testBug894878() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.