diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/xpath/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/xpath/index.html')
-rw-r--r-- | files/zh-cn/web/xpath/index.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/files/zh-cn/web/xpath/index.html b/files/zh-cn/web/xpath/index.html new file mode 100644 index 0000000000..5905c3209f --- /dev/null +++ b/files/zh-cn/web/xpath/index.html @@ -0,0 +1,62 @@ +--- +title: XPath +slug: Web/XPath +tags: + - XPath +translation_of: Web/XPath +--- +<p><span class="seoSummary">XPath 的意思是 XML 路径语言。它使用的一个非 XML 语法提供一种灵活地定位 <a href="/zh-CN/docs/XML" title="XML">XML</a> 文档的不同部分的方法。它同时也可以用于检测文档中某个节点是否与某个模式(pattern)匹配。</span></p> + +<p>XPath 主要被用于 <a href="/zh-CN/docs/XSLT" title="XSLT">XSLT</a>,也可用于定位文档元素,像类 XML 语言文档(如HTML 和 <a href="/zh-CN/docs/XUL" title="XUL">XUL</a> ) 通过 <a href="/zh-CN/docs/DOM" title="DOM">DOM</a> 定位元素一样。替代 {{Domxref("document.getElementById")}} 方法、 {{Domxref("element.childNodes")}} 属性和其他DOM核心特性。</p> + +<p>XPath 使用路径标识符通过层级结构来导航XML文档。它使用非XML语法,以致于它可以被用在URIs和XML属性值上。</p> + +<div class="note"> +<p><strong>注意:</strong>XPath 的浏览器支持差别很大;Firefox 支持地相当不错 (尽管没有计划进一步提高支持),而其他浏览器则较小程度地实现了它。如果你需要一个兼容主流浏览器的 XPath,你可以考虑试试 <a href="http://nchc.dl.sourceforge.net/project/js-xpath/js-xpath/1.0.0/xpath.js">js-xpath</a> 或 <a href="https://github.com/google/wicked-good-xpath">wicked-good-xpath</a>.</p> +</div> + +<div class="row topicpage-table"> +<div class="section"> +<h2 class="Documentation" id="Documentation" name="Documentation">文档</h2> + + <dl> + <dt><a href="/zh-CN/docs/Introduction_to_using_XPath_in_JavaScript" title="Introduction_to_using_XPath_in_JavaScript">在 JavaScript 中使用 XPath 的介绍</a></dt> + <dd>描述了 XPath 的一个非 XSLT 使用。</dd> + <dt><a href="/en-US/docs/XPath/Axes" title="XPath/Axes">XPath:Axes</a></dt> + <dd>List and definition of the axes defined in the XPath specification. Axes are used to describe the relationships between nodes.</dd> + <dt><a href="/en-US/docs/XPath/Functions" title="XPath/Functions">XPath:Functions</a></dt> + <dd>List and description of the core XPath functions and XSLT-specific additions to XPath.</dd> + <dt><a href="/en-US/docs/Transforming_XML_with_XSLT" title="Transforming_XML_with_XSLT">Transforming XML with XSLT</a></dt> + <dd>XSLT uses XPath to address code segments in a XML document that it wishes to transform.</dd> + <dt><a href="/en-US/docs/Web/XPath/Snippets" title="Using_XPath">XPath snippets</a></dt> + <dd>JavaScript utility functions to use in your own code, based on <a class="external external-icon" href="http://www.w3.org/TR/DOM-Level-3-XPath/">DOM Level 3 XPath </a>APIs.</dd> + <dt><a class="external" href="http://www.xml.com/pub/a/2000/08/holman/">What is XSLT?</a></dt> + <dd>This extensive introduction to XSLT and XPath assumes no prior knowledge of the technologies, and guides the reader through background, context, structure, concepts and introductory terminology.</dd> + <dt><a href="/en-US/docs/JXON" title="/en-US/docs/JXON">JXON</a></dt> + <dd><strong>JXON</strong> (lossless <strong>J</strong>avaScript <strong>X</strong>ML <strong>O</strong>bject <strong>N</strong>otation) is a generic name by which is defined the representation of JavaScript Objects using <a href="/en/XML" title="en/XML">XML</a>. There are some cases in which the whole content of an XML document must be read from the JavaScript interpreter (like for web-apps languages or settings XML documents, for example). In these cases JXON could represent the most practical way and a valid alternative to XPath.</dd> + </dl> + +<p><span class="alllinks"><a href="/en-US/docs/tag/XPath" title="tag/XPath">View All...</a></span></p> +</div> + +<div class="section"> +<h2 class="Tools" id="Tools" name="Tools">工具</h2> + +<dl> + <dt><a class="link-https" href="https://addons.mozilla.org/zh-CN/firefox/addon/1192">XPather</a></dt> + <dd>Feature rich XPath generator, editor, inspector, and simple extraction tool (FireFox Add-On).</dd> + <dt><a class="link-https" href="https://addons.mozilla.org/zh-CN/firefox/addon/11900" title="https://addons.mozilla.org/zh-CN/firefox/addon/11900">FireXPath</a></dt> + <dd>XPath panel that integrates tightly into FireBug, providing an editor and inspector (FireFox Add-On).</dd> + <dt><a class="external" href="http://qutoric.com/xmlquire/">XMLQuire (formerly known as SketchPath)</a></dt> + <dd>A Graphical XPath Builder/Debugger(.NET).</dd> +</dl> + +<h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">相关主题</h2> + +<ul> + <li><a href="/zh-CN/docs/XSLT" title="XSLT">XSLT</a>, <a href="/zh-CN/docs/XQuery" title="XQuery">XQuery</a>, <a href="/zh-CN/docs/XML" title="XML">XML</a>, <a href="/zh-CN/docs/DOM" title="DOM">DOM</a>, <a href="/zh-CN/docs/JXON" title="/zh-CN/docs/JXON">JXON</a>, <a href="/zh-CN/docs/JSON/JSONPath" title="JSON/JSONPath">JSONPath</a></li> +</ul> +</div> +</div> + +<div>{{QuickLinksWithSubpages("/zh-CN/docs/Web/XPath")}}</div> |