DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> XML學習教程 >> XML詳解 >> XPath 操作符
XPath 操作符
編輯:XML詳解     

下面給出了XPath表達式所支持的所有操作符:

Operator

  操作符

Description

  注釋

Example

  實例

Return value

  返回值

| Computes two node-sets

  連接兩條語句

//book | //cd Returns a node-set with all book and cd elements

  返回所有book和cd的節點屬性

+ Addition

  加

6 + 4 10 - Subtraction

  減

6 - 4 2 * Multiplication

  乘

6 * 4 24 div Division

  除

8 div 4 2 = Equal

  等

price=9.80 true if price is 9.80

  false if price is 9.90

  返回true或false

!= Not equal

  不等

price!=9.80 true if price is 9.90

  false if price is 9.80

  返回true或false

< Less than

  小於

price<9.80 true if price is 9.00

  false if price is 9.80

  返回true或false

<= Less than or equal to

  小於等於

price<=9.80 true if price is 9.00

  false if price is 9.90

  返回true或false

> Greater than

  大於

price>9.80 true if price is 9.90

  false if price is 9.80

  返回true或false

>= Greater than or equal to

  大於等於

price>=9.80 true if price is 9.90

  false if price is 9.70

  返回true或false

or or price=9.80 or price=9.70 true if price is 9.80

  false if price is 9.50

  邏輯連接,判斷兩個條件中的一個

and and price>9.00 and price<9.90 true if price is 9.80

  false if price is 8.50

  邏輯連接,同時判斷兩個條件

mod Modulus (division remainder)

  求余

5 mod 2 1


XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved