XPath 介绍

来源:互联网 发布:js的非阻塞sleep函数 编辑:程序博客网 时间:2024/06/05 11:49

XPath is a language for finding information in an XML document. XPath is used to navigate through elements and attributes in an XML document.
XPath是用于在XML文档中查找信息的语言。 XPath用于为XML文档中的元素和属性提供导航。


What You Should Already Know
为了进一步学习XPath,你需要事先掌握下面的知识

Before you continue you should have a basic understanding of the following:
在你继续学习XPath之前,你需要了解下面这几个基本概念:

  • HTML / XHTML
  • XML / XML 命名空间

If you want to study these subjects first, find the tutorials on our Home page of tutorial.
如果你希望学习上述知识,可以从我们的教程首页获取相关的教程链接。


What is XPath?
到底XPath是什么?

  • XPath is a syntax for defining parts of an XML document
  • XPath 是一种用于定义XML文档的语法
  • XPath uses path expressions to navigate in XML documents
  • XPath 使用路径表达式对XML文档中的元素进行导航
  • XPath contains a library of standard functions
  • XPath 包含一个标准函数库
  • XPath is a major element in XSLT
  • XPath 是XSLT的主要元素
  • XPath is a W3C Standard
  • XPath 是W3C标准

XPath Path Expressions
XPath 路径表达式

XPath uses path expressions to select nodes or node-sets in an XML document. These path expressions look very much like the expressions you see when you work with a traditional computer file system.
XPath使用路径表达式从XML文档中选取节点或节点集。这些路径表达式与传统的计算机文件操作系统中的路径表达式非常相似。


XPath Standard Functions
XPath 标准函数

XPath includes over 100 built-in functions. There are functions for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, Boolean values, and more.
XPath包含100多种内置函数。这些函数用于字符串值、数值、日期和时间表、节点和QName处理、序列处理、逻辑值等等。


XPath is Used in XSLT
XPath用于XSLT

XPath is a major element in the XSLT standard. Without XPath knowledge you will not be able to create XSLT documents.
XPath是XSLT标准中的一个重要元素。你必须具备足够的XPath知识才能创建XSLT文档。

You can read more about XSLT in our XSLT tutorial.
你可以从我们的XSLT教程中学习更多关于XSLT的知识。

XQuery and XPointer are both built on XPath expressions. XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators.
XQuery 和 XPointer 都是基于XPath表达式构建的。它们同时共享同一个的数据模式并支持相同的函数和操作符。

You can read more about XQuery in our XQuery tutorial.
你可以从我们的XQuery教程中学习更多关于XQuery的知识。


XPath is a W3C Standard
XPath 是 W3C 标准

XPath became a W3C Recommendation 16. November 1999.
XPath 于1999年11月16日成为W3C标准。

XPath was designed to be used by XSLT, XPointer and other XML parsing software.
创建 XPath 的目的是为了使它能够被 XSLT、XPointer以及其它 XML 解析器软件所使用。

You can read more about the XPath standard in our W3C tutorial.
你可以从我们的W3C教程中学习更多关于W3C的知识。

原创粉丝点击