Package org.jaxen.dom

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


    }   
 
    public void testStringLengthOfString() throws JaxenException
    {
        XPath xpath = new DOMXPath( "string-length('0123456789')" );
        Double result = (Double) xpath.evaluate( doc );
        assertEquals(10, result.intValue());
    }   
 
    public void testStringLengthFunctionOperatesOnContextNode()
      throws JaxenException {
View Full Code Here


 
    public void testStringLengthFunctionOperatesOnContextNode()
      throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("string-length()");
        Double result = (Double) xpath.evaluate( doc );
        assertEquals(0, result.intValue());
       
    }   

    public void testStringLengthFunctionCountsUnicodeCharactersNotJavaChars()
View Full Code Here

    public void testStringLengthFunctionCountsUnicodeCharactersNotJavaChars()
      throws JaxenException {
  
        BaseXPath xpath = new DOMXPath("string-length('\uD834\uDD00')");
        Double result = (Double) xpath.evaluate( doc );
        assertEquals(1, result.intValue());
       
    }   

    public void testStringLengthFunctionWithMalformedString()
View Full Code Here

    public void testStringLengthFunctionWithMalformedString()
      throws JaxenException {
  
        BaseXPath xpath = new DOMXPath("string-length('\uD834A\uDD00')");
        try {
            xpath.evaluate( doc );
            fail("Allowed Malformed string");
        }
        catch (FunctionCallException ex) {
            assertNotNull(ex.getMessage());
        }
View Full Code Here

   

    public void testTranslateNonBMPChars() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('ab\uD834\uDD00b', '\uD834\uDD00', 'd')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("abdb", result);
    }  
   

    public void testTranslateNonBMPChars2() throws JaxenException
View Full Code Here

   

    public void testTranslateNonBMPChars2() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('ab\uD834\uDD00b', '\uD834\uDD00', 'da')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("abdb", result);
    }  
   

    public void testTranslateWithNonBMPChars() throws JaxenException
View Full Code Here

   

    public void testTranslateWithNonBMPChars() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', '\uD834\uDD00')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("ab\uD834\uDD00", result);
    }  
   

    public void testTranslateWithNonBMPChars2() throws JaxenException
View Full Code Here

   

    public void testTranslateWithNonBMPChars2() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', '\uD834\uDD00b')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("ab\uD834\uDD00", result);
    }  
   

    public void testTranslateWithMalformedSurrogatePair() throws JaxenException
View Full Code Here

    public void testTranslateWithMalformedSurrogatePair() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', '\uD834X\uDD00b')" );
        try {
            xpath.evaluate( doc );
            fail("Allowed malformed surrogate pair");
        }
        catch (FunctionCallException ex) {
            assertNotNull(ex.getMessage());
        }
View Full Code Here

    public void testTranslateWithMissingLowSurrogate() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', 'AB\uD834X')" );
        try {
            xpath.evaluate( doc );
            fail("Allowed malformed surrogate pair");
        }
        catch (FunctionCallException ex) {
            assertNotNull(ex.getMessage());
        }
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.