📜  XPath数字运算符函数

📅  最后修改于: 2020-12-26 07:02:07             🧑  作者: Mango

XPath编号运算符/函数

与XPath表达式一起使用的数字运算符的列表:

Index Operator Description
1) + It is used for addition operation.
2) It is used for subtraction operation.
3) * It is used for multiplication operation.
4) div It is used for division operation.
5) mod It is used for modulo operation

XPath表达式使用的数字功能列表:

Index Function Description
1) ceiling() It is used to return the smallest integer larger than the value provided.
2) floor() It is used to return the largest integer smaller than the value provided.
3) round() It is used to return the rounded value to nearest integer.
4) sum() It is used to return the sum of two numbers.

XPath编号运算符/函数示例

让我们以创建一个元素表为例,该表具有其属性ID和其子元素。它计算员工的薪水,然后显示结果。

Employee.xml




   
      Abhiram
      Kushwaha
      Manoj
      15000
   
   
      Akash
      Singh
      Bunty
      25000
   
    
      Brijesh
      Kaushik
      Ballu
      20000
   
    
      Zoya
      Mansoori
      Sonam
      30000
   

员工.xsl


  
   
      
         
            

Employee

ID First Name Last Name Nick Name Salary Grade
High Medium Low

输出: