Examples of numberValueOf()


Examples of org.jaxen.dom.DOMXPath.numberValueOf()

    {
        try
        {
            final DOMXPath path = new DOMXPath( str );
            path.setNamespaceContext( new JaxenResolver(resolver) );
            return path.numberValueOf( contextNode );
        }
        catch( final Exception e )
        {
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Failed to evaluate '" + str + "'", e);
View Full Code Here

Examples of org.jaxen.dom.DOMXPath.numberValueOf()

        BaseXPath xpath = new DOMXPath("1 + 2");
       
        String stringValue = xpath.stringValueOf(xpath);
        assertEquals("3", stringValue);
       
        Number numberValue = xpath.numberValueOf(xpath);
        assertEquals(3, numberValue.doubleValue(), 0.00001);
       
    }
   
   
View Full Code Here

Examples of org.jaxen.dom.DOMXPath.numberValueOf()

    public void testNumberValueOfEmptyNodeSetIsNaN() throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("/x");
       
        doc.appendChild(doc.createElement("root"));
        Double numberValue = (Double) xpath.numberValueOf(doc);
        assertTrue(numberValue.isNaN());
       
    }
   
   
View Full Code Here

Examples of org.jaxen.dom.DOMXPath.numberValueOf()

        doc.appendChild(root);
        root.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.example.org/");
       
        DOMXPath xpath = new DOMXPath( "count(/*/@*)" );
       
        Number value = xpath.numberValueOf(doc);
        assertEquals(0, value.intValue());
       
    }

   
View Full Code Here

Examples of org.jaxen.dom.DOMXPath.numberValueOf()

    {
        try
        {
            final DOMXPath path = new DOMXPath( str );
            path.setNamespaceContext( new JaxenResolver(resolver) );
            return path.numberValueOf( contextNode );
        }
        catch( final Exception e )
        {
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Failed to evaluate '" + str + "'", e);
View Full Code Here

Examples of org.jaxen.dom.DOMXPath.numberValueOf()

        doc.appendChild(root);
        root.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.example.org/");
       
        DOMXPath xpath = new DOMXPath( "count(/*/@*)" );
       
        Number value = xpath.numberValueOf(doc);
        assertEquals(0, value.intValue());
       
    }

   
View Full Code Here

Examples of org.jdom.xpath.XPath.numberValueOf()

     */
  public static Number selectNumber(Element xml, String xpath, List<Namespace> theNSs) throws JDOMException {

    XPath xp = prepareXPath(xml, xpath, theNSs);

    return xp.numberValueOf(xml);
  }

    /**
     * Search in metadata all matching element for the filter
     * and return a list of uuid separated by or to be used in a
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.