1 16 19 package org.apache.xpath.operations; 20 21 import org.apache.xpath.XPathContext; 22 import org.apache.xpath.objects.XBoolean; 23 import org.apache.xpath.objects.XObject; 24 25 28 public class Equals extends Operation 29 { 30 31 42 public XObject operate(XObject left, XObject right) 43 throws javax.xml.transform.TransformerException 44 { 45 return left.equals(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; 46 } 47 48 59 public boolean bool(XPathContext xctxt) 60 throws javax.xml.transform.TransformerException 61 { 62 XObject left = m_left.execute(xctxt, true); 63 XObject right = m_right.execute(xctxt, true); 64 65 boolean result = left.equals(right) ? true : false; 66 left.detach(); 67 right.detach(); 68 return result; 69 } 70 71 } 72 | Popular Tags |