XPath中如何比较不同类型的对象[5]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 superlmj 的 blog

    boolean comparebasic(object operand1, object operand2, string operator) throws exception{

        if (operator is "<=" or "<" or ">=" or ">"){

            convert operand1 and operand2 to number

            compare the two numbers with the operator;

        }else if("=".equals(operator)||"!=".equals(operator)){

            if(at least one object is boolean){convert the other object to boolean}

            if(at least one object is number){convert the other object to number}

本文关键:XPath中如何比较不同类型的对象
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top