添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
礼貌的土豆  ·  全新Tandem网页版·  4 周前    · 
逃课的鼠标垫  ·  Nat. ...·  2 月前    · 
强健的日记本  ·  奋进新征程 ...·  2 月前    · 
憨厚的苦咖啡  ·  Debugging ASP.NET ...·  3 月前    · 
Previous Home Next
  1. Introduction

    1. What is XPath?

    2. Expressions

      This XPath statement consists of a 'for' expression which is used to iterate over items in a sequence . In this case, the sequence of items over which the 'for' expression iterates is identified by the location path expression '/company/office/employee'. This example shows that XPath statements are not limited to one type of expression, but are more often than not constructed from a combination of many different expressions.

      Because of their importance in gaining a fundamental understanding of XPath, Chapter 2 is dedicated to covering location path expressions in greater detail. Chapter 3 covers the other types of XPath expressions which include iterative expressions, conditional expressions, quantitative expressions, comparison expressions etc.

    3. Sequences

      The function is a new item type. In XPath 2.0 an item in a sequence could only be a node or atomic value, in XPath 3.0 an item can be a node, atomic value or a function.

      In many of the examples in this training you will see an XPath expression followed by the result of the expression. Only in cases where the result is an empty sequence or a sequence which contains multiple items, will the result be contained in parentheses. If the result is an error, or a sequence which contains only one item, the result will not be shown in parentheses..

      ()
      This example shows the empty sequence i.e. a sequence which contains no items.
      (4)
      This example shows a singleton sequence with one item which is an 'xs:integer' of value 4.
      (4, 8, 75, 16, 2)
      
      This example shows a sequence with multiple items, all of which are of type 'xs:integer'.
      (5, 'hello', 75, 'world', 2, /company/office/employee/first_name)
      
      This example shows a sequence with multiple items. The items include values of the atomic types 'xs:string' and 'xs:integer' as well as a location path which evaluates to a number of items of 'type' element node.
    4. XPath version history