CINXE.COM
XPath - Wikipedia
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>XPath - Wikipedia</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )enwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy", "wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"1935a0e3-e4f8-4838-bf6e-b3fa604457a3","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"XPath","wgTitle":"XPath","wgCurRevisionId":1236325233,"wgRevisionId":1236325233,"wgArticleId":19086670,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["CS1 maint: unfit URL","Articles with short description","Short description is different from Wikidata","Wikipedia references cleanup from March 2014","All articles needing references cleanup","Articles covered by WikiProject Wikify from March 2014","All articles covered by WikiProject Wikify","Articles needing additional references from August 2010","All articles needing additional references","Wikipedia introduction cleanup from May 2020","All pages needing cleanup", "Articles covered by WikiProject Wikify from May 2020","Articles with multiple maintenance issues","All Wikipedia articles needing clarification","Wikipedia articles needing clarification from December 2015","Query languages","XML data access"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"XPath","wgRelevantArticleId":19086670,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgFlaggedRevsParams":{"tags":{"status":{"levels":1}}},"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":30000,"wgRelatedArticlesCompat":[ ],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q16340","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.cite.styles":"ready","ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","jquery.makeCollapsible.styles":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript": "ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","ext.pygments.view","mediawiki.page.media","site","mediawiki.page.ready","jquery.makeCollapsible","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.ReferenceTooltips","ext.gadget.switcher","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns","ext.cx.uls.quick.actions","wikibase.client.vector-2022","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.cite.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cjquery.makeCollapsible.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="XPath - Wikipedia"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//en.m.wikipedia.org/wiki/XPath"> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=XPath&action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (en)"> <link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://en.wikipedia.org/wiki/XPath"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en"> <link rel="alternate" type="application/atom+xml" title="Wikipedia Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-XPath rootpage-XPath skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-contents" class="mw-list-item"><a href="/wiki/Wikipedia:Contents" title="Guides to browsing Wikipedia"><span>Contents</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/Portal:Current_events" title="Articles related to current events"><span>Current events</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Visit a randomly selected article [x]" accesskey="x"><span>Random article</span></a></li><li id="n-aboutsite" class="mw-list-item"><a href="/wiki/Wikipedia:About" title="Learn about Wikipedia and how it works"><span>About Wikipedia</span></a></li><li id="n-contactpage" class="mw-list-item"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us" title="How to contact Wikipedia"><span>Contact us</span></a></li> </ul> </div> </div> <div id="p-interaction" class="vector-menu mw-portlet mw-portlet-interaction" > <div class="vector-menu-heading"> Contribute </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Help:Contents" title="Guidance on how to use and edit Wikipedia"><span>Help</span></a></li><li id="n-introduction" class="mw-list-item"><a href="/wiki/Help:Introduction" title="Learn how to edit Wikipedia"><span>Learn to edit</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikipedia:Community_portal" title="The hub for editors"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes to Wikipedia [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-upload" class="mw-list-item"><a href="/wiki/Wikipedia:File_upload_wizard" title="Add images or other media for use on Wikipedia"><span>Upload file</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Main_Page" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipedia" src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" style="width: 7.5em; height: 1.125em;"> <img class="mw-logo-tagline" alt="The Free Encyclopedia" src="/static/images/mobile/copyright/wikipedia-tagline-en.svg" width="117" height="13" style="width: 7.3125em; height: 0.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search Wikipedia [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search Wikipedia" aria-label="Search Wikipedia" autocapitalize="sentences" title="Search Wikipedia [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikipedia.org&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=XPath" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=XPath" title="You're encouraged to log in; however, it's not mandatory. [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Log in and more options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikipedia.org&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=XPath" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=XPath" title="You're encouraged to log in; however, it's not mandatory. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contents</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">(Top)</div> </a> </li> <li id="toc-Overview" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Overview"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Overview</span> </div> </a> <button aria-controls="toc-Overview-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Overview subsection</span> </button> <ul id="toc-Overview-sublist" class="vector-toc-list"> <li id="toc-Versions" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Versions"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.1</span> <span>Versions</span> </div> </a> <ul id="toc-Versions-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Syntax_and_semantics_(XPath_1.0)" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Syntax_and_semantics_(XPath_1.0)"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Syntax and semantics (XPath 1.0)</span> </div> </a> <button aria-controls="toc-Syntax_and_semantics_(XPath_1.0)-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Syntax and semantics (XPath 1.0) subsection</span> </button> <ul id="toc-Syntax_and_semantics_(XPath_1.0)-sublist" class="vector-toc-list"> <li id="toc-Abbreviated_syntax" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Abbreviated_syntax"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>Abbreviated syntax</span> </div> </a> <ul id="toc-Abbreviated_syntax-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Expanded_syntax" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Expanded_syntax"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>Expanded syntax</span> </div> </a> <ul id="toc-Expanded_syntax-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Axis_specifiers" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Axis_specifiers"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3</span> <span>Axis specifiers</span> </div> </a> <ul id="toc-Axis_specifiers-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Node_tests" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Node_tests"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.4</span> <span>Node tests</span> </div> </a> <ul id="toc-Node_tests-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Predicates" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Predicates"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.5</span> <span>Predicates</span> </div> </a> <ul id="toc-Predicates-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Functions_and_operators" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Functions_and_operators"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.6</span> <span>Functions and operators</span> </div> </a> <ul id="toc-Functions_and_operators-sublist" class="vector-toc-list"> <li id="toc-Node_set_functions" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Node_set_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.6.1</span> <span>Node set functions</span> </div> </a> <ul id="toc-Node_set_functions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-String_functions" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#String_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.6.2</span> <span>String functions</span> </div> </a> <ul id="toc-String_functions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Boolean_functions" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Boolean_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.6.3</span> <span>Boolean functions</span> </div> </a> <ul id="toc-Boolean_functions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Number_functions" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Number_functions"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.6.4</span> <span>Number functions</span> </div> </a> <ul id="toc-Number_functions-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Usage_examples" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Usage_examples"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.7</span> <span>Usage examples</span> </div> </a> <ul id="toc-Usage_examples-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Syntax_and_semantics_(XPath_2.0)" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Syntax_and_semantics_(XPath_2.0)"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Syntax and semantics (XPath 2.0)</span> </div> </a> <ul id="toc-Syntax_and_semantics_(XPath_2.0)-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Syntax_and_semantics_(XPath_3)" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Syntax_and_semantics_(XPath_3)"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Syntax and semantics (XPath 3)</span> </div> </a> <ul id="toc-Syntax_and_semantics_(XPath_3)-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Examples" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Examples"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Examples</span> </div> </a> <ul id="toc-Examples-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Implementations" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Implementations"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Implementations</span> </div> </a> <button aria-controls="toc-Implementations-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Implementations subsection</span> </button> <ul id="toc-Implementations-sublist" class="vector-toc-list"> <li id="toc-Command-line_tools" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Command-line_tools"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.1</span> <span>Command-line tools</span> </div> </a> <ul id="toc-Command-line_tools-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-C/C++" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#C/C++"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.2</span> <span>C/C++</span> </div> </a> <ul id="toc-C/C++-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Free_Pascal" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Free_Pascal"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.3</span> <span>Free Pascal</span> </div> </a> <ul id="toc-Free_Pascal-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Implementations_for_database_engines" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Implementations_for_database_engines"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.4</span> <span>Implementations for database engines</span> </div> </a> <ul id="toc-Implementations_for_database_engines-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Java" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Java"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.5</span> <span>Java</span> </div> </a> <ul id="toc-Java-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-JavaScript" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#JavaScript"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.6</span> <span>JavaScript</span> </div> </a> <ul id="toc-JavaScript-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-.NET_Framework" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#.NET_Framework"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.7</span> <span>.NET Framework</span> </div> </a> <ul id="toc-.NET_Framework-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Perl" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Perl"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.8</span> <span>Perl</span> </div> </a> <ul id="toc-Perl-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-PHP" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#PHP"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.9</span> <span>PHP</span> </div> </a> <ul id="toc-PHP-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Python" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Python"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.10</span> <span>Python</span> </div> </a> <ul id="toc-Python-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Ruby" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Ruby"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.11</span> <span>Ruby</span> </div> </a> <ul id="toc-Ruby-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Scheme" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Scheme"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.12</span> <span>Scheme</span> </div> </a> <ul id="toc-Scheme-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-SQL" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#SQL"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.13</span> <span>SQL</span> </div> </a> <ul id="toc-SQL-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Tcl" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Tcl"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.14</span> <span>Tcl</span> </div> </a> <ul id="toc-Tcl-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Use_in_schema_languages" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Use_in_schema_languages"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>Use in schema languages</span> </div> </a> <ul id="toc-Use_in_schema_languages-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>See also</span> </div> </a> <ul id="toc-See_also-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Notes" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Notes"> <div class="vector-toc-text"> <span class="vector-toc-numb">9</span> <span>Notes</span> </div> </a> <ul id="toc-Notes-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-References" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#References"> <div class="vector-toc-text"> <span class="vector-toc-numb">10</span> <span>References</span> </div> </a> <ul id="toc-References-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-External_links" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#External_links"> <div class="vector-toc-text"> <span class="vector-toc-numb">11</span> <span>External links</span> </div> </a> <ul id="toc-External_links-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">XPath</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Go to an article in another language. Available in 28 languages" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-28" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">28 languages</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D8%A5%D9%83%D8%B3%D8%A8%D8%A7%D8%AB" title="إكسباث – Arabic" lang="ar" hreflang="ar" data-title="إكسباث" data-language-autonym="العربية" data-language-local-name="Arabic" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-bs mw-list-item"><a href="https://bs.wikipedia.org/wiki/XPath" title="XPath – Bosnian" lang="bs" hreflang="bs" data-title="XPath" data-language-autonym="Bosanski" data-language-local-name="Bosnian" class="interlanguage-link-target"><span>Bosanski</span></a></li><li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikipedia.org/wiki/XPath" title="XPath – Czech" lang="cs" hreflang="cs" data-title="XPath" data-language-autonym="Čeština" data-language-local-name="Czech" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/XPath" title="XPath – Danish" lang="da" hreflang="da" data-title="XPath" data-language-autonym="Dansk" data-language-local-name="Danish" class="interlanguage-link-target"><span>Dansk</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/XPath" title="XPath – German" lang="de" hreflang="de" data-title="XPath" data-language-autonym="Deutsch" data-language-local-name="German" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/XPath" title="XPath – Spanish" lang="es" hreflang="es" data-title="XPath" data-language-autonym="Español" data-language-local-name="Spanish" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-eu mw-list-item"><a href="https://eu.wikipedia.org/wiki/XPath" title="XPath – Basque" lang="eu" hreflang="eu" data-title="XPath" data-language-autonym="Euskara" data-language-local-name="Basque" class="interlanguage-link-target"><span>Euskara</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D8%A7%DA%A9%D8%B3%E2%80%8C%D9%BE%D8%AA" title="اکسپت – Persian" lang="fa" hreflang="fa" data-title="اکسپت" data-language-autonym="فارسی" data-language-local-name="Persian" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/XPath" title="XPath – French" lang="fr" hreflang="fr" data-title="XPath" data-language-autonym="Français" data-language-local-name="French" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/XPath" title="XPath – Korean" lang="ko" hreflang="ko" data-title="XPath" data-language-autonym="한국어" data-language-local-name="Korean" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/XPath" title="XPath – Indonesian" lang="id" hreflang="id" data-title="XPath" data-language-autonym="Bahasa Indonesia" data-language-local-name="Indonesian" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-is mw-list-item"><a href="https://is.wikipedia.org/wiki/XPath" title="XPath – Icelandic" lang="is" hreflang="is" data-title="XPath" data-language-autonym="Íslenska" data-language-local-name="Icelandic" class="interlanguage-link-target"><span>Íslenska</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/XPath" title="XPath – Italian" lang="it" hreflang="it" data-title="XPath" data-language-autonym="Italiano" data-language-local-name="Italian" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-he badge-Q70894304 mw-list-item" title=""><a href="https://he.wikipedia.org/wiki/XPath" title="XPath – Hebrew" lang="he" hreflang="he" data-title="XPath" data-language-autonym="עברית" data-language-local-name="Hebrew" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-lt mw-list-item"><a href="https://lt.wikipedia.org/wiki/XPath" title="XPath – Lithuanian" lang="lt" hreflang="lt" data-title="XPath" data-language-autonym="Lietuvių" data-language-local-name="Lithuanian" class="interlanguage-link-target"><span>Lietuvių</span></a></li><li class="interlanguage-link interwiki-hu mw-list-item"><a href="https://hu.wikipedia.org/wiki/XPath" title="XPath – Hungarian" lang="hu" hreflang="hu" data-title="XPath" data-language-autonym="Magyar" data-language-local-name="Hungarian" class="interlanguage-link-target"><span>Magyar</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/XPath" title="XPath – Dutch" lang="nl" hreflang="nl" data-title="XPath" data-language-autonym="Nederlands" data-language-local-name="Dutch" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/XML_Path_Language" title="XML Path Language – Japanese" lang="ja" hreflang="ja" data-title="XML Path Language" data-language-autonym="日本語" data-language-local-name="Japanese" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/XPath" title="XPath – Polish" lang="pl" hreflang="pl" data-title="XPath" data-language-autonym="Polski" data-language-local-name="Polish" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/XPath" title="XPath – Portuguese" lang="pt" hreflang="pt" data-title="XPath" data-language-autonym="Português" data-language-local-name="Portuguese" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ro mw-list-item"><a href="https://ro.wikipedia.org/wiki/XPath" title="XPath – Romanian" lang="ro" hreflang="ro" data-title="XPath" data-language-autonym="Română" data-language-local-name="Romanian" class="interlanguage-link-target"><span>Română</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/XPath" title="XPath – Russian" lang="ru" hreflang="ru" data-title="XPath" data-language-autonym="Русский" data-language-local-name="Russian" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/XPath" title="XPath – Serbian" lang="sr" hreflang="sr" data-title="XPath" data-language-autonym="Српски / srpski" data-language-local-name="Serbian" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/XPath" title="XPath – Finnish" lang="fi" hreflang="fi" data-title="XPath" data-language-autonym="Suomi" data-language-local-name="Finnish" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/XPath" title="XPath – Swedish" lang="sv" hreflang="sv" data-title="XPath" data-language-autonym="Svenska" data-language-local-name="Swedish" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/XPath" title="XPath – Turkish" lang="tr" hreflang="tr" data-title="XPath" data-language-autonym="Türkçe" data-language-local-name="Turkish" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/XPath" title="XPath – Ukrainian" lang="uk" hreflang="uk" data-title="XPath" data-language-autonym="Українська" data-language-local-name="Ukrainian" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/XPath" title="XPath – Chinese" lang="zh" hreflang="zh" data-title="XPath" data-language-autonym="中文" data-language-local-name="Chinese" class="interlanguage-link-target"><span>中文</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q16340#sitelinks-wikipedia" title="Edit interlanguage links" class="wbc-editpage">Edit links</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/XPath" title="View the content page [c]" accesskey="c"><span>Article</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Talk:XPath" rel="discussion" title="Discuss improvements to the content page [t]" accesskey="t"><span>Talk</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/XPath"><span>Read</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=XPath&action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=XPath&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/XPath"><span>Read</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=XPath&action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=XPath&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/XPath" title="List of all English Wikipedia pages containing links to this page [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/XPath" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="/wiki/Wikipedia:File_Upload_Wizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=XPath&oldid=1236325233" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=XPath&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Special:CiteThisPage&page=XPath&id=1236325233&wpFormIdentifier=titleform" title="Information on how to cite this page"><span>Cite this page</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FXPath"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FXPath"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=XPath&action=show-download-screen" title="Download this page as a PDF file"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=XPath&printable=yes" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="wb-otherproject-link wb-otherproject-commons mw-list-item"><a href="https://commons.wikimedia.org/wiki/Category:XPath" hreflang="en"><span>Wikimedia Commons</span></a></li><li class="wb-otherproject-link wb-otherproject-wikibooks mw-list-item"><a href="https://en.wikibooks.org/wiki/XPath" hreflang="en"><span>Wikibooks</span></a></li><li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q16340" title="Structured data on this page hosted by Wikidata [g]" accesskey="g"><span>Wikidata item</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">From Wikipedia, the free encyclopedia</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">Expression language for XML documents</div> <style data-mw-deduplicate="TemplateStyles:r1251242444">.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}</style><style data-mw-deduplicate="TemplateStyles:r1248332772">.mw-parser-output .multiple-issues-text{width:95%;margin:0.2em 0}.mw-parser-output .multiple-issues-text>.mw-collapsible-content{margin-top:0.3em}.mw-parser-output .compact-ambox .ambox{border:none;border-collapse:collapse;background-color:transparent;margin:0 0 0 1.6em!important;padding:0!important;width:auto;display:block}body.mediawiki .mw-parser-output .compact-ambox .ambox.mbox-small-left{font-size:100%;width:auto;margin:0}.mw-parser-output .compact-ambox .ambox .mbox-text{padding:0!important;margin:0!important}.mw-parser-output .compact-ambox .ambox .mbox-text-span{display:list-item;line-height:1.5em;list-style-type:disc}body.skin-minerva .mw-parser-output .multiple-issues-text>.mw-collapsible-toggle,.mw-parser-output .compact-ambox .ambox .mbox-image,.mw-parser-output .compact-ambox .ambox .mbox-imageright,.mw-parser-output .compact-ambox .ambox .mbox-empty-cell,.mw-parser-output .compact-ambox .hide-when-compact{display:none}</style><table class="box-Multiple_issues plainlinks metadata ambox ambox-content ambox-multiple_issues compact-ambox" role="presentation"><tbody><tr><td class="mbox-image"><div class="mbox-image-div"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/en/thumb/b/b4/Ambox_important.svg/40px-Ambox_important.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/b/b4/Ambox_important.svg/60px-Ambox_important.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/b/b4/Ambox_important.svg/80px-Ambox_important.svg.png 2x" data-file-width="40" data-file-height="40" /></span></span></div></td><td class="mbox-text"><div class="mbox-text-span"><div class="multiple-issues-text mw-collapsible"><b>This article has multiple issues.</b> Please help <b><a href="/wiki/Special:EditPage/XPath" title="Special:EditPage/XPath">improve it</a></b> or discuss these issues on the <b><a href="/wiki/Talk:XPath" title="Talk:XPath">talk page</a></b>. <small><i>(<a href="/wiki/Help:Maintenance_template_removal" title="Help:Maintenance template removal">Learn how and when to remove these messages</a>)</i></small> <div class="mw-collapsible-content"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1251242444"><table class="box-Citation_style plainlinks metadata ambox ambox-style ambox-citation_style" role="presentation"><tbody><tr><td class="mbox-image"><div class="mbox-image-div"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/en/thumb/f/f2/Edit-clear.svg/40px-Edit-clear.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/f/f2/Edit-clear.svg/60px-Edit-clear.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/f/f2/Edit-clear.svg/80px-Edit-clear.svg.png 2x" data-file-width="48" data-file-height="48" /></span></span></div></td><td class="mbox-text"><div class="mbox-text-span">This article <b>has an unclear <a href="/wiki/Wikipedia:Citing_sources#Citation_style" title="Wikipedia:Citing sources">citation style</a></b>. The reason given is: <b>Violates Wikipedia:External links: "Wikipedia articles may include links to web pages outside Wikipedia (external links), but they should not normally be used in the body of an article."</b><span class="hide-when-compact"> The references used may be made clearer with a different or consistent style of <a href="/wiki/Wikipedia:Citing_sources" title="Wikipedia:Citing sources">citation</a> and <a href="/wiki/Help:Footnotes" title="Help:Footnotes">footnoting</a>.</span> <span class="date-container"><i>(<span class="date">March 2014</span>)</i></span><span class="hide-when-compact"><i> (<small><a href="/wiki/Help:Maintenance_template_removal" title="Help:Maintenance template removal">Learn how and when to remove this message</a></small>)</i></span></div></td></tr></tbody></table> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1251242444"><table class="box-More_citations_needed plainlinks metadata ambox ambox-content ambox-Refimprove" role="presentation"><tbody><tr><td class="mbox-image"><div class="mbox-image-div"><span typeof="mw:File"><a href="/wiki/File:Question_book-new.svg" class="mw-file-description"><img alt="" src="//upload.wikimedia.org/wikipedia/en/thumb/9/99/Question_book-new.svg/50px-Question_book-new.svg.png" decoding="async" width="50" height="39" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/9/99/Question_book-new.svg/75px-Question_book-new.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/9/99/Question_book-new.svg/100px-Question_book-new.svg.png 2x" data-file-width="512" data-file-height="399" /></a></span></div></td><td class="mbox-text"><div class="mbox-text-span">This article <b>needs additional citations for <a href="/wiki/Wikipedia:Verifiability" title="Wikipedia:Verifiability">verification</a></b>.<span class="hide-when-compact"> Please help <a href="/wiki/Special:EditPage/XPath" title="Special:EditPage/XPath">improve this article</a> by <a href="/wiki/Help:Referencing_for_beginners" title="Help:Referencing for beginners">adding citations to reliable sources</a>. Unsourced material may be challenged and removed.<br /><small><span class="plainlinks"><i>Find sources:</i> <a rel="nofollow" class="external text" href="https://www.google.com/search?as_eq=wikipedia&q=%22XPath%22">"XPath"</a> – <a rel="nofollow" class="external text" href="https://www.google.com/search?tbm=nws&q=%22XPath%22+-wikipedia&tbs=ar:1">news</a> <b>·</b> <a rel="nofollow" class="external text" href="https://www.google.com/search?&q=%22XPath%22&tbs=bkt:s&tbm=bks">newspapers</a> <b>·</b> <a rel="nofollow" class="external text" href="https://www.google.com/search?tbs=bks:1&q=%22XPath%22+-wikipedia">books</a> <b>·</b> <a rel="nofollow" class="external text" href="https://scholar.google.com/scholar?q=%22XPath%22">scholar</a> <b>·</b> <a rel="nofollow" class="external text" href="https://www.jstor.org/action/doBasicSearch?Query=%22XPath%22&acc=on&wc=on">JSTOR</a></span></small></span> <span class="date-container"><i>(<span class="date">August 2010</span>)</i></span><span class="hide-when-compact"><i> (<small><a href="/wiki/Help:Maintenance_template_removal" title="Help:Maintenance template removal">Learn how and when to remove this message</a></small>)</i></span></div></td></tr></tbody></table> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1251242444"><table class="box-Lead_too_short plainlinks metadata ambox ambox-content ambox-lead_too_short" role="presentation"><tbody><tr><td class="mbox-image"><div class="mbox-image-div"><span typeof="mw:File"><a href="/wiki/File:Wiki_letter_w.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/en/thumb/6/6c/Wiki_letter_w.svg/40px-Wiki_letter_w.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/6/6c/Wiki_letter_w.svg/60px-Wiki_letter_w.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/6/6c/Wiki_letter_w.svg/80px-Wiki_letter_w.svg.png 2x" data-file-width="44" data-file-height="44" /></a></span></div></td><td class="mbox-text"><div class="mbox-text-span">This article's <a href="/wiki/Wikipedia:Manual_of_Style/Lead_section#Length" title="Wikipedia:Manual of Style/Lead section">lead section</a> <b>may be too short to adequately <a href="/wiki/Wikipedia:Summary_style" title="Wikipedia:Summary style">summarize</a> the key points</b>.<span class="hide-when-compact"> Please consider expanding the lead to <a href="/wiki/Wikipedia:Manual_of_Style/Lead_section#Provide_an_accessible_overview" title="Wikipedia:Manual of Style/Lead section">provide an accessible overview</a> of all important aspects of the article.</span> <span class="date-container"><i>(<span class="date">May 2020</span>)</i></span></div></td></tr></tbody></table> </div> </div><span class="hide-when-compact"><i> (<small><a href="/wiki/Help:Maintenance_template_removal" title="Help:Maintenance template removal">Learn how and when to remove this message</a></small>)</i></span></div></td></tr></tbody></table> <style data-mw-deduplicate="TemplateStyles:r1257001546">.mw-parser-output .infobox-subbox{padding:0;border:none;margin:-3px;width:auto;min-width:100%;font-size:100%;clear:none;float:none;background-color:transparent}.mw-parser-output .infobox-3cols-child{margin:auto}.mw-parser-output .infobox .navbar{font-size:100%}@media screen{html.skin-theme-clientpref-night .mw-parser-output .infobox-full-data:not(.notheme)>div:not(.notheme)[style]{background:#1f1f23!important;color:#f8f9fa}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .infobox-full-data:not(.notheme) div:not(.notheme){background:#1f1f23!important;color:#f8f9fa}}@media(min-width:640px){body.skin--responsive .mw-parser-output .infobox-table{display:table!important}body.skin--responsive .mw-parser-output .infobox-table>caption{display:table-caption!important}body.skin--responsive .mw-parser-output .infobox-table>tbody{display:table-row-group}body.skin--responsive .mw-parser-output .infobox-table tr{display:table-row!important}body.skin--responsive .mw-parser-output .infobox-table th,body.skin--responsive .mw-parser-output .infobox-table td{padding-left:inherit;padding-right:inherit}}</style><table class="infobox vevent"><caption class="infobox-title summary">XPath</caption><tbody><tr><th scope="row" class="infobox-label"><a href="/wiki/Programming_paradigm" title="Programming paradigm">Paradigm</a></th><td class="infobox-data"><a href="/wiki/Query_language" title="Query language">Query language</a></td></tr><tr><th scope="row" class="infobox-label"><a href="/wiki/Software_developer" class="mw-redirect" title="Software developer">Developer</a></th><td class="infobox-data organiser"><a href="/wiki/W3C" class="mw-redirect" title="W3C">W3C</a></td></tr><tr><th scope="row" class="infobox-label">First appeared</th><td class="infobox-data">1998</td></tr><tr><td colspan="2" class="infobox-full-data"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1257001546"></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="/wiki/Software_release_life_cycle" title="Software release life cycle">Stable release</a></th><td class="infobox-data"><div style="margin:0px;">3.1 / March 21, 2017<span class="noprint">; 7 years ago</span><span style="display:none"> (<span class="bday dtstart published updated">2017-03-21</span>)</span></div></td></tr><tr style="display:none"><td colspan="2"> </td></tr><tr><th colspan="2" class="infobox-header" style="background-color: #eee;">Influenced by</th></tr><tr><td colspan="2" class="infobox-full-data"><a href="/wiki/XSLT" title="XSLT">XSLT</a>, <a href="/wiki/XPointer" title="XPointer">XPointer</a></td></tr><tr><th colspan="2" class="infobox-header" style="background-color: #eee;">Influenced</th></tr><tr><td colspan="2" class="infobox-full-data"><a href="/wiki/XML_Schema_(W3C)" title="XML Schema (W3C)">XML Schema</a>, <a href="/wiki/XForms" title="XForms">XForms</a>, <a href="/wiki/JSONPath" title="JSONPath">JSONPath</a></td></tr></tbody></table> <p><b>XPath</b> (<b>XML Path Language</b>) is an <a href="/wiki/Expression_language" title="Expression language">expression language</a> designed to support the query or transformation of <a href="/wiki/XML" title="XML">XML</a> documents. It was defined by the <a href="/wiki/World_Wide_Web_Consortium" title="World Wide Web Consortium">World Wide Web Consortium</a> (W3C) in 1999,<sup id="cite_ref-timelinehistory_1-0" class="reference"><a href="#cite_note-timelinehistory-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> and can be used to compute values (e.g., <a href="/wiki/String_(computer_science)" title="String (computer science)">strings</a>, numbers, or <a href="/wiki/Boolean_value" class="mw-redirect" title="Boolean value">Boolean values</a>) from the content of an XML document. Support for XPath exists in applications that support XML, such as web browsers, and many programming languages. </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Overview">Overview</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=1" title="Edit section: Overview"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The XPath language is based on a <a href="/wiki/XML_tree" title="XML tree">tree representation of the XML document</a>, and provides the ability to navigate around the tree, selecting nodes by a variety of criteria.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> In popular use (though not in the official specification), an XPath expression is often referred to simply as "an XPath". </p><p>Originally motivated by a desire to provide a common syntax and behavior model between <a href="/wiki/XPointer" title="XPointer">XPointer</a> and <a href="/wiki/XSLT" title="XSLT">XSLT</a>, subsets of the XPath <a href="/wiki/Query_language" title="Query language">query language</a> are used in other <a href="/wiki/W3C" class="mw-redirect" title="W3C">W3C</a> specifications such as <a href="/wiki/W3C_XML_Schema" class="mw-redirect" title="W3C XML Schema">XML Schema</a>, <a href="/wiki/XForms" title="XForms">XForms</a> and the <a href="/wiki/Internationalization_Tag_Set" title="Internationalization Tag Set">Internationalization Tag Set (ITS)</a>. </p><p>XPath has been adopted by a number of XML processing libraries and tools, many of which also offer <a href="/wiki/Cascading_Style_Sheets" class="mw-redirect" title="Cascading Style Sheets">CSS Selectors</a>, another W3C standard, as a simpler alternative to XPath. </p> <div class="mw-heading mw-heading3"><h3 id="Versions">Versions</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=2" title="Edit section: Versions"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>There are several versions of XPath in use. XPath 1.0 was published in 1999, XPath 2.0 in 2007 (with a second edition in 2010), XPath 3.0 in 2014, and XPath 3.1 in 2017. However, XPath 1.0 is still the version that is most widely available.<sup id="cite_ref-timelinehistory_1-1" class="reference"><a href="#cite_note-timelinehistory-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> </p> <ul><li>XPath 1.0 became a Recommendation on 16 November 1999 and is widely implemented and used, either on its own (called via an API from languages such as <a href="/wiki/Java_(programming_language)" title="Java (programming language)">Java</a>, <a href="/wiki/C_Sharp_(programming_language)" title="C Sharp (programming language)">C#</a>, <a href="/wiki/Python_(programming_language)" title="Python (programming language)">Python</a> or <a href="/wiki/JavaScript" title="JavaScript">JavaScript</a>), or embedded in languages such as <a href="/wiki/XSLT" title="XSLT">XSLT</a>, <a href="/wiki/XProc" title="XProc">XProc</a>, <a href="/wiki/XML_Schema_(W3C)" title="XML Schema (W3C)">XML Schema</a> or <a href="/wiki/XForms" title="XForms">XForms</a>.</li> <li><a href="/wiki/XPath_2.0" title="XPath 2.0">XPath 2.0</a> became a Recommendation on 23 January 2007, with a second edition published on 14 December 2010. A number of implementations exist but are not as widely used as XPath 1.0. The XPath 2.0 language specification is much larger than XPath 1.0 and changes some of the fundamental concepts of the language such as the type system. <dl><dd>The most notable change is that XPath 2.0 is built around the <a href="/wiki/XQuery_and_XPath_Data_Model" title="XQuery and XPath Data Model">XQuery and XPath Data Model</a> (XDM) that has a much richer type system.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>a<span class="cite-bracket">]</span></a></sup> Every value is now a sequence (a single atomic value or node is regarded as a sequence of length one). XPath 1.0 node-sets are replaced by node sequences, which may be in any order.</dd> <dd>To support richer type sets, XPath 2.0 offers a greatly expanded set of functions and operators.</dd> <dd>XPath 2.0 is in fact a subset of <a href="/wiki/XQuery" title="XQuery">XQuery</a> 1.0. They share the same data model (<a href="/wiki/XQuery_and_XPath_Data_Model" title="XQuery and XPath Data Model">XDM</a>). It offers a <code>for</code> expression that is a cut-down version of the "<a href="/wiki/FLWOR" title="FLWOR">FLWOR</a>" expressions in XQuery. It is possible to describe the language by listing the parts of XQuery that it leaves out: the main examples are the query prolog, element and attribute constructors, the remainder of the "FLWOR" syntax, and the <code>typeswitch</code> expression.</dd></dl></li> <li><a href="/wiki/XPath_3.0" class="mw-redirect" title="XPath 3.0">XPath 3.0</a> became a Recommendation on 8 April 2014.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> The most significant new feature is support for functions as first-class values.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> XPath 3.0 is a subset of XQuery 3.0, and most current implementations (April 2014) exist as part of an XQuery 3.0 engine.</li> <li>XPath 3.1 became a Recommendation on 21 March 2017.<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> This version adds new data types: maps and arrays, largely to underpin support for <a href="/wiki/JSON" title="JSON">JSON</a>.</li></ul> <figure typeof="mw:File/Thumb"><a href="/wiki/File:XPath_example.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/8/87/XPath_example.svg/300px-XPath_example.svg.png" decoding="async" width="300" height="250" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/8/87/XPath_example.svg/450px-XPath_example.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/8/87/XPath_example.svg/600px-XPath_example.svg.png 2x" data-file-width="480" data-file-height="400" /></a><figcaption>XPath expression applied to an XML file</figcaption></figure> <div class="mw-heading mw-heading2"><h2 id="Syntax_and_semantics_(XPath_1.0)"><span id="Syntax_and_semantics_.28XPath_1.0.29"></span>Syntax and semantics (XPath 1.0)</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=3" title="Edit section: Syntax and semantics (XPath 1.0)"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The most important kind of expression in XPath is a <i>location path</i>. A location path consists of a sequence of <i>location steps</i>. Each location step has three components: </p> <ul><li>an <i><a href="#Axis_specifiers">axis</a></i></li> <li>a <i><a href="#Node_tests">node test</a></i></li> <li>zero or more <i><a href="#Predicates">predicates</a></i>.</li></ul> <p>An XPath expression is evaluated with respect to a <i>context node</i>. An Axis Specifier such as 'child' or 'descendant' specifies the direction to navigate from the context node. The node test and the predicate are used to filter the nodes specified by the axis specifier: For example, the node test 'A' requires that all nodes navigated to must have label 'A'. A predicate can be used to specify that the selected nodes have certain properties, which are specified by XPath expressions themselves. </p><p>The XPath syntax comes in two flavors: the <i>abbreviated syntax</i>, is more compact and allows XPaths to be written and read easily using intuitive and, in many cases, familiar characters and constructs. The <i>full syntax</i> is more verbose, but allows for more options to be specified, and is more descriptive if read carefully. </p> <div class="mw-heading mw-heading3"><h3 id="Abbreviated_syntax">Abbreviated syntax</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=4" title="Edit section: Abbreviated syntax"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The compact notation allows many defaults and abbreviations for common cases. Given source XML containing at least </p> <div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span></span><span class="nt"><A></span> <span class="w"> </span><span class="nt"><B></span> <span class="w"> </span><span class="nt"><C/></span> <span class="w"> </span><span class="nt"></B></span> <span class="nt"></A></span> </pre></div> <p>the simplest XPath takes a form such as </p> <ul><li><code>/A/B/C</code></li></ul> <p>that selects C elements that are children of B elements that are children of the A element that forms the outermost element of the XML document. The XPath syntax is designed to mimic URI (<a href="/wiki/Uniform_Resource_Identifier" title="Uniform Resource Identifier">Uniform Resource Identifier</a>) and <a href="/wiki/File_path#Unix_style" class="mw-redirect" title="File path">Unix-style file path</a> syntax. </p><p>More complex expressions can be constructed by specifying an axis other than the default 'child' axis, a node test other than a simple name, or predicates, which can be written in square brackets after any step. For example, the expression </p> <ul><li><code>A//B/*[1]</code></li></ul> <p>selects the first child ('<code>*[1]</code>'), whatever its name, of every B element that itself is a child or other, deeper descendant ('<code>//</code>') of an A element that is a child of the current context node (the expression does not begin with a '<code>/</code>'). The predicate <code>[1]</code> binds more tightly than the <code>/</code> operator. To select the first node selected by the expression <code>A//B/*</code>, write <code>(A//B/*)[1]</code>. Note also, index values in XPath predicates (technically, 'proximity positions' of XPath node sets) start from 1, not 0 as common in languages like C and Java. </p> <div class="mw-heading mw-heading3"><h3 id="Expanded_syntax">Expanded syntax</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=5" title="Edit section: Expanded syntax"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>In the full, unabbreviated syntax, the two examples above would be written </p> <ul><li><code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="p">/</span><span class="k">child</span><span class="p">::</span><span class="nt">A</span><span class="p">/</span><span class="k">child</span><span class="p">::</span><span class="nt">B</span><span class="p">/</span><span class="k">child</span><span class="p">::</span><span class="nt">C</span></code></li> <li><code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="k">child</span><span class="p">::</span><span class="nt">A</span><span class="p">/</span><span class="k">descendant-or-self</span><span class="p">::</span><span class="nf">node</span><span class="p">()/</span><span class="k">child</span><span class="p">::</span><span class="nt">B</span><span class="p">/</span><span class="k">child</span><span class="p">::</span><span class="nf">node</span><span class="p">()[</span><span class="nf">position</span><span class="p">()</span><span class="o">=</span><span class="mi">1</span><span class="p">]</span></code></li></ul> <p>Here, in each step of the XPath, the <b>axis</b> (e.g. <code>child</code> or <code>descendant-or-self</code>) is explicitly specified, followed by <code>::</code> and then the <b>node test</b>, such as <code>A</code> or <code>node()</code> in the examples above. </p><p>Here the same, but shorter: <code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="nt">A</span><span class="p">//</span><span class="nt">B</span><span class="p">/</span><span class="nt">*</span><span class="p">[</span><span class="nf">position</span><span class="p">()</span><span class="o">=</span><span class="mi">1</span><span class="p">]</span></code> </p> <div class="mw-heading mw-heading3"><h3 id="Axis_specifiers">Axis specifiers</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=6" title="Edit section: Axis specifiers"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Axis specifiers indicate navigation direction within the tree representation of the XML document. The axes available are:<sup id="cite_ref-WalshAxisViz_9-0" class="reference"><a href="#cite_note-WalshAxisViz-9"><span class="cite-bracket">[</span>b<span class="cite-bracket">]</span></a></sup> </p> <table class="wikitable"> <caption>Axis specifiers in XPath </caption> <tbody><tr> <th scope="col">Full syntax </th> <th scope="col">Abbreviated syntax </th> <th scope="col">Notes </th></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">ancestor</code></td> <td></td> <td> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">ancestor-or-self</code></td> <td></td> <td> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">attribute</code> </td> <td align="center"><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">@</code> </td> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">@abc</code> is short for <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">attribute::abc</code> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">child</code></td> <td></td> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">xyz</code> is short for <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">child::xyz</code> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">descendant</code> </td> <td align="center"><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">//</code> </td> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">//</code> is short for <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">/descendant-or-self::node()/</code> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">descendant-or-self</code></td> <td></td> <td> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">following</code></td> <td></td> <td> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">following-sibling</code></td> <td></td> <td> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">namespace</code></td> <td></td> <td> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">parent</code> </td> <td align="center"><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">..</code> </td> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">..</code> is short for <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">parent::node()</code> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">preceding</code></td> <td></td> <td> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">preceding-sibling</code></td> <td></td> <td> </td></tr> <tr> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">self</code> </td> <td align="center"><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">.</code> </td> <td><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">.</code> is short for <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">self::node()</code> </td></tr></tbody></table> <p>As an example of using the <b>attribute</b> axis in abbreviated syntax, <code>//a/@href</code> selects the attribute called <code>href</code> in <code>a</code> elements anywhere in the document tree. The expression <b>.</b> (an abbreviation for <b>self::node()</b>) is most commonly used within a predicate to refer to the currently selected node. For example, <code>h3[.='See also']</code> selects an element called <code>h3</code> in the current context, whose text content is <code>See also</code>. </p> <div class="mw-heading mw-heading3"><h3 id="Node_tests">Node tests</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=7" title="Edit section: Node tests"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Node tests may consist of specific node names or more general expressions. In the case of an XML document in which the namespace prefix <code>gs</code> has been defined, <code>//gs:enquiry</code> will find all the <code>enquiry</code> elements in that namespace, and <code>//gs:*</code> will find all elements, regardless of local name, in that namespace. </p><p>Other node test formats are: </p> <dl><dt><style data-mw-deduplicate="TemplateStyles:r886049734">.mw-parser-output .monospaced{font-family:monospace,monospace}</style><span class="monospaced">comment()</span></dt> <dd>finds an XML comment node, e.g. <code><!-- Comment --></code></dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">text()</span></dt> <dd>finds a node of type text excluding any children, e.g. the <code>hello</code> in <code><k>hello<m> world</m></k></code></dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">processing-instruction()</span></dt> <dd>finds XML <a href="/wiki/Processing_instruction" class="mw-redirect" title="Processing instruction">processing instructions</a> such as <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="cp"><?php</span> <span class="k">echo</span> <span class="nv">$a</span><span class="p">;</span> <span class="cp">?></span></code>. In this case, <code>processing-instruction('php')</code> would match.</dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">node()</span></dt> <dd>finds any node at all.</dd></dl> <div class="mw-heading mw-heading3"><h3 id="Predicates">Predicates</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=8" title="Edit section: Predicates"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Predicates, written as expressions in square brackets, can be used to <a href="/wiki/Filter_(higher-order_function)" title="Filter (higher-order function)">filter</a> a node-set according to some condition. For example, <code>a</code> returns a node-set (all the <code>a</code> elements which are children of the context node), and <code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="nt">a</span><span class="p">[</span><span class="na">@href</span><span class="o">=</span><span class="s1">'help.php'</span><span class="p">]</span></code> keeps only those elements having an <code>href</code> attribute with the value <code>help.php</code>. </p><p>There is no limit to the number of predicates in a step, and they need not be confined to the last step in an XPath. They can also be nested to any depth. Paths specified in predicates begin at the context of the current step (i.e. that of the immediately preceding node test) and do not alter that context. All predicates must be satisfied for a match to occur. </p><p>When the value of the predicate is numeric, it is syntactic-sugar for comparing against the node's position in the node-set (as given by the function <code>position()</code>). So <code>p[1]</code> is shorthand for <code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="nt">p</span><span class="p">[</span><span class="nf">position</span><span class="p">()</span><span class="o">=</span><span class="mi">1</span><span class="p">]</span></code> and selects the first <code>p</code> element child, while <code>p[last()]</code> is shorthand for <code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="nt">p</span><span class="p">[</span><span class="nf">position</span><span class="p">()</span><span class="o">=</span><span class="nf">last</span><span class="p">()]</span></code> and selects the last <code>p</code> child of the context node. </p><p>In other cases, the value of the predicate is automatically converted to a Boolean. When the predicate evaluates to a node-set, the result is true when the node-set is <span class="clarify-content" style="padding-left:0.1em; padding-right:0.1em; color:var(--color-subtle, #54595d); border:1px solid var(--border-color-subtle, #c8ccd1);">non-empty</span><sup class="noprint Inline-Template Template-Clarify" style="margin-left:0.1em; white-space:nowrap;">[<i><a href="/wiki/Wikipedia:Please_clarify" title="Wikipedia:Please clarify"><span title="This passage needs to be better explained. (December 2015)">clarify</span></a></i>]</sup>. Thus <code>p[@x]</code> selects those <code>p</code> elements that have an attribute named <code>x</code>. </p><p>A more complex example: the expression <code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="nt">a</span><span class="p">[/</span><span class="nt">html</span><span class="p">/</span><span class="na">@lang</span><span class="o">=</span><span class="s1">'en'</span><span class="p">][</span><span class="na">@href</span><span class="o">=</span><span class="s1">'help.php'</span><span class="p">][</span><span class="mi">1</span><span class="p">]/</span><span class="na">@target</span></code> selects the value of the <code>target</code> attribute of the first <code>a</code> element among the children of the context node that has its <code>href</code> attribute set to <code>help.php</code>, provided the document's <code>html</code> top-level element also has a <code>lang</code> attribute set to <code>en</code>. The reference to an attribute of the top-level element in the first predicate affects neither the context of other predicates nor that of the location step itself. </p><p>Predicate order is significant if predicates test the position of a node. Each predicate takes a node-set returns a (potentially) smaller node-set. So <code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="nt">a</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="na">@href</span><span class="o">=</span><span class="s1">'help.php'</span><span class="p">]</span></code> will find a match only if the first <code>a</code> child of the context node satisfies the condition <code>@href='help.php'</code>, while <code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="nt">a</span><span class="p">[</span><span class="na">@href</span><span class="o">=</span><span class="s1">'help.php'</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span></code> will find the first <code>a</code> child that satisfies this condition. </p> <div class="mw-heading mw-heading3"><h3 id="Functions_and_operators">Functions and operators</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=9" title="Edit section: Functions and operators"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>XPath 1.0 defines four data types: node-sets (sets of nodes with no intrinsic order), strings, numbers and Booleans. </p><p>The available operators are: </p> <ul><li>The <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">/</code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">//</code> and <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">[...]</code> operators, used in path expressions, as described above.</li> <li>A union operator, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">|</code>, which forms the union of two node-sets.</li> <li>Boolean operators <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">and</code> and <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">or</code>, and a function <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">not()</code></li> <li>Arithmetic operators <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">+</code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">-</code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">*</code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">div</code> (divide), and <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">mod</code></li> <li>Comparison operators <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">=</code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">!=</code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr"><</code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">></code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr"><=</code>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">>=</code></li></ul> <p>The function library includes: </p> <ul><li>Functions to manipulate strings: <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">concat(), substring(), contains(), substring-before(), substring-after(), translate(), normalize-space(), string-length()</span></li> <li>Functions to manipulate numbers: <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">sum(), round(), floor(), ceiling()</span></li> <li>Functions to get properties of nodes: <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">name(), local-name(), namespace-uri()</span></li> <li>Functions to get information about the processing context: <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">position(), last()</span></li> <li>Type conversion functions: <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">string(), number(), boolean()</span></li></ul> <p>Some of the more commonly useful functions are detailed below.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>c<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading4"><h4 id="Node_set_functions">Node set functions</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=10" title="Edit section: Node set functions"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <dl><dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">position()</span></dt> <dd>returns a number representing the position of this node in the sequence of nodes currently being processed (for example, the nodes selected by an xsl:for-each instruction in XSLT).</dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">count(<i>node-set</i>)</span></dt> <dd>returns the number of nodes in the node-set supplied as its argument.</dd></dl> <div class="mw-heading mw-heading4"><h4 id="String_functions">String functions</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=11" title="Edit section: String functions"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <dl><dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">string(<i>object</i>?)</span></dt> <dd>converts any of the four XPath data types into a string according to built-in rules. If the value of the argument is a node-set, the function returns the string-value of the first node in document order, ignoring any further nodes.</dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">concat(<i>string</i>, <i>string</i>, <i>string</i>*)</span></dt> <dd><a href="/wiki/Concatenation" title="Concatenation">concatenates</a> two or more strings</dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">starts-with(<i>s1</i>, <i>s2</i>)</span></dt> <dd>returns <code>true</code> if <code>s1</code> starts with <code>s2</code></dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">contains(<i>s1</i>, <i>s2</i>)</span></dt> <dd>returns <code>true</code> if <code>s1</code> contains <code>s2</code></dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">substring(<i>string</i>, <i>start</i>, <i>length</i>?)</span></dt> <dd>example: <code>substring("ABCDEF",2,3)</code> returns <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">BCD</code>.</dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">substring-before(<i>s1</i>, <i>s2</i>)</span></dt> <dd>example: <code>substring-before("1999/04/01","/")</code> returns <code>1999</code></dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">substring-after(<i>s1</i>, <i>s2</i>)</span></dt> <dd>example: <code>substring-after("1999/04/01","/")</code> returns <code>04/01</code></dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">string-length(string?)</span></dt> <dd>returns number of characters in string</dd> <dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">normalize-space(<i>string</i>?)</span></dt> <dd>all leading and trailing <a href="/wiki/Whitespace_(computer_science)" class="mw-redirect" title="Whitespace (computer science)">whitespace</a> is removed and any sequences of whitespace characters are replaced by a single space. This is very useful when the original XML may have been <a href="/wiki/Prettyprint" title="Prettyprint">prettyprint</a> formatted, which could make further string processing unreliable.</dd></dl> <div class="mw-heading mw-heading4"><h4 id="Boolean_functions">Boolean functions</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=12" title="Edit section: Boolean functions"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <dl><dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">not(<i>boolean</i>)</span></dt> <dd>negates any Boolean expression.</dd></dl> <dl><dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">true()</span></dt> <dd>evaluates to <i>true</i>.</dd></dl> <dl><dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">false()</span></dt> <dd>evaluates to <i>false</i>.</dd></dl> <div class="mw-heading mw-heading4"><h4 id="Number_functions">Number functions</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=13" title="Edit section: Number functions"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <dl><dt><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r886049734"><span class="monospaced">sum(<i>node-set</i>)</span></dt> <dd>converts the string values of all the nodes found by the XPath argument into numbers, according to the built-in casting rules, then returns the sum of these numbers.</dd></dl> <div class="mw-heading mw-heading3"><h3 id="Usage_examples">Usage examples</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=14" title="Edit section: Usage examples"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Expressions can be created inside predicates using the operators: <code>=, !=, <=, <, >=</code> and <code>></code>. Boolean expressions may be combined with brackets <code>()</code> and the Boolean operators <code>and</code> and <code>or</code> as well as the <code>not()</code> function described above. Numeric calculations can use <code>*, +, -, div</code> and <code>mod</code>. Strings can consist of any <a href="/wiki/Unicode" title="Unicode">Unicode</a> characters. </p><p><code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="p">//</span><span class="nt">item</span><span class="p">[</span><span class="na">@price</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">2</span><span class="o">*</span><span class="na">@discount</span><span class="p">]</span></code> selects items whose price attribute is greater than twice the numeric value of their discount attribute. </p><p>Entire node-sets can be combined (<a href="/wiki/Union_(set_theory)" title="Union (set theory)">'unioned'</a>) using the vertical bar character |. Node sets that meet one or more of several conditions can be found by combining the conditions inside a predicate with '<code>or</code>'. </p><p><code>v[x or y] | w[z]</code> will return a single node-set consisting of all the <code>v</code> elements that have <code>x</code> or <code>y</code> child-elements, as well as all the <code>w</code> elements that have <code>z</code> child-elements, that were found in the current context. </p> <div class="mw-heading mw-heading2"><h2 id="Syntax_and_semantics_(XPath_2.0)"><span id="Syntax_and_semantics_.28XPath_2.0.29"></span>Syntax and semantics (XPath 2.0)</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=15" title="Edit section: Syntax and semantics (XPath 2.0)"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1236090951">.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}</style><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/XPath_2.0" title="XPath 2.0">XPath 2.0</a></div> <div class="mw-heading mw-heading2"><h2 id="Syntax_and_semantics_(XPath_3)"><span id="Syntax_and_semantics_.28XPath_3.29"></span>Syntax and semantics (XPath 3)</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=16" title="Edit section: Syntax and semantics (XPath 3)"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/XPath_3" title="XPath 3">XPath 3</a></div> <div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=17" title="Edit section: Examples"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Given a sample XML document </p> <div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span></span><span class="cp"><?xml version="1.0" encoding="utf-8"?></span> <span class="nt"><Wikimedia></span> <span class="w"> </span><span class="nt"><projects></span> <span class="w"> </span><span class="nt"><project</span><span class="w"> </span><span class="na">name=</span><span class="s">"Wikipedia"</span><span class="w"> </span><span class="na">launch=</span><span class="s">"2001-01-05"</span><span class="nt">></span> <span class="w"> </span><span class="nt"><editions></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"English"</span><span class="nt">></span>en.wikipedia.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"German"</span><span class="nt">></span>de.wikipedia.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"French"</span><span class="nt">></span>fr.wikipedia.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"Polish"</span><span class="nt">></span>pl.wikipedia.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"Spanish"</span><span class="nt">></span>es.wikipedia.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"></editions></span> <span class="w"> </span><span class="nt"></project></span> <span class="w"> </span><span class="nt"><project</span><span class="w"> </span><span class="na">name=</span><span class="s">"Wiktionary"</span><span class="w"> </span><span class="na">launch=</span><span class="s">"2002-12-12"</span><span class="nt">></span> <span class="w"> </span><span class="nt"><editions></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"English"</span><span class="nt">></span>en.wiktionary.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"French"</span><span class="nt">></span>fr.wiktionary.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"Vietnamese"</span><span class="nt">></span>vi.wiktionary.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"Turkish"</span><span class="nt">></span>tr.wiktionary.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"><edition</span><span class="w"> </span><span class="na">language=</span><span class="s">"Spanish"</span><span class="nt">></span>es.wiktionary.org<span class="nt"></edition></span> <span class="w"> </span><span class="nt"></editions></span> <span class="w"> </span><span class="nt"></project></span> <span class="w"> </span><span class="nt"></projects></span> <span class="nt"></Wikimedia></span> </pre></div> <p>The XPath expression </p> <pre>/Wikimedia/projects/project/@name </pre> <p>selects name attributes for all projects, and </p> <pre>/Wikimedia//editions </pre> <p>selects all editions of all projects, and </p> <pre><code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="p">/</span><span class="nt">Wikimedia</span><span class="p">/</span><span class="nt">projects</span><span class="p">/</span><span class="nt">project</span><span class="p">/</span><span class="nt">editions</span><span class="p">/</span><span class="nt">edition</span><span class="p">[</span><span class="na">@language</span><span class="o">=</span><span class="s1">'English'</span><span class="p">]/</span><span class="nf">text</span><span class="p">()</span></code> </pre> <p>selects addresses of all English Wikimedia projects (text of all <code>edition</code> elements where <code>language</code> attribute is equal to <i>English</i>). And the following </p> <pre><code class="mw-highlight mw-highlight-lang-xquery mw-content-ltr" style="" dir="ltr"><span class="p">/</span><span class="nt">Wikimedia</span><span class="p">/</span><span class="nt">projects</span><span class="p">/</span><span class="nt">project</span><span class="p">[</span><span class="na">@name</span><span class="o">=</span><span class="s1">'Wikipedia'</span><span class="p">]/</span><span class="nt">editions</span><span class="p">/</span><span class="nt">edition</span><span class="p">/</span><span class="nf">text</span><span class="p">()</span></code> </pre> <p>selects addresses of all Wikipedias (text of all <code>edition</code> elements that exist under <code>project</code> element with a name attribute of <i>Wikipedia</i>). </p> <div class="mw-heading mw-heading2"><h2 id="Implementations">Implementations</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=18" title="Edit section: Implementations"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Command-line_tools">Command-line tools</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=19" title="Edit section: Command-line tools"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/XMLStarlet" title="XMLStarlet">XMLStarlet</a> easy to use tool to test/execute XPath commands on the fly.</li> <li><a href="/wiki/Libxml2" title="Libxml2">xmllint (libxml2)</a></li> <li>RaptorXML Server from Altova supports XPath 1.0, 2.0, and 3.0</li> <li><a rel="nofollow" class="external text" href="http://www.videlibri.de/xidel.html">Xidel</a></li></ul> <div class="mw-heading mw-heading3"><h3 id="C/C++"><span id="C.2FC.2B.2B"></span>C/C++</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=20" title="Edit section: C/C++"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/Libxml2" title="Libxml2">libxml2</a></li> <li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20150408041815/http://www.corefiling.com/opensource/pathan.html">Pathan</a></li> <li><a rel="nofollow" class="external text" href="http://pugixml.org/">pugixml</a></li> <li><a href="/wiki/Sedna_(database)" title="Sedna (database)">Sedna XML Database</a></li> <li><a href="/wiki/VTD-XML" title="VTD-XML">VTD-XML</a></li> <li><a href="/wiki/Xalan" class="mw-redirect" title="Xalan">Xalan</a></li> <li><a rel="nofollow" class="external text" href="http://xqilla.sourceforge.net/HomePage">XQilla</a></li></ul> <div class="mw-heading mw-heading3"><h3 id="Free_Pascal">Free Pascal</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=21" title="Edit section: Free Pascal"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li>The unit XPath is included in the default libraries</li></ul> <div class="mw-heading mw-heading3"><h3 id="Implementations_for_database_engines">Implementations for database engines</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=22" title="Edit section: Implementations for database engines"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/Virtuoso_Universal_Server" title="Virtuoso Universal Server">OpenLink Virtuoso</a></li></ul> <div class="mw-heading mw-heading3"><h3 id="Java">Java</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=23" title="Edit section: Java"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/Saxon_XSLT" title="Saxon XSLT">Saxon XSLT</a> supports XPath 1.0, XPath 2.0 and XPath 3.0 (as well as XSLT 2.0, XQuery 3.0, and XPath 3.0)</li> <li><a href="/wiki/BaseX" title="BaseX">BaseX</a> (also supports XPath 2.0 and XQuery)</li> <li><a href="/wiki/VTD-XML" title="VTD-XML">VTD-XML</a></li> <li>Sedna XML Database Both XML:DB and proprietary.</li> <li><a rel="nofollow" class="external text" href="https://code.google.com/p/quixpath">QuiXPath</a> a <a href="/wiki/Streaming_XML" class="mw-redirect" title="Streaming XML">streaming</a> <a href="/wiki/Open_source" title="Open source">open source</a> implementation by Innovimax</li> <li><a href="/wiki/Xalan" class="mw-redirect" title="Xalan">Xalan</a></li> <li><a href="/wiki/Dom4j" title="Dom4j">Dom4j</a></li></ul> <p>The <a href="/wiki/Java_(programming_language)" title="Java (programming language)">Java</a> package <b><code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/19/docs/api/java.xml/javax/xml/xpath/package-summary.html">javax.xml.xpath</a></code></b> has been part of Java standard edition since Java 5<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> via the <a href="/wiki/Java_API_for_XML_Processing" title="Java API for XML Processing">Java API for XML Processing</a>. Technically this is an XPath <a href="/wiki/API" title="API">API</a> rather than an XPath implementation, and it allows the programmer the ability to select a specific implementation that conforms to the interface. </p> <div class="mw-heading mw-heading3"><h3 id="JavaScript">JavaScript</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=24" title="Edit section: JavaScript"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a rel="nofollow" class="external text" href="https://github.com/ilinsky/jquery-xpath/">jQuery XPath plugin</a> based on <a rel="nofollow" class="external text" href="https://github.com/ilinsky/xpath.js">Open-source XPath 2.0 implementation in JavaScript</a></li> <li><a rel="nofollow" class="external text" href="https://github.com/FontoXML/fontoxpath">FontoXPath</a> Open source XPath 3.1 implementation in JavaScript. Currently under development.</li></ul> <div class="mw-heading mw-heading3"><h3 id=".NET_Framework">.NET Framework</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=25" title="Edit section: .NET Framework"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li>In the System.Xml and System.Xml.XPath namespaces<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></li> <li>Sedna XML Database</li></ul> <div class="mw-heading mw-heading3"><h3 id="Perl">Perl</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=26" title="Edit section: Perl"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a rel="nofollow" class="external text" href="https://metacpan.org/pod/XML::LibXML">XML::LibXML</a> (libxml2)</li></ul> <div class="mw-heading mw-heading3"><h3 id="PHP">PHP</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=27" title="Edit section: PHP"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li>Sedna XML Database</li> <li><a rel="nofollow" class="external text" href="https://www.php.net/manual/en/class.domxpath.php">DOMXPath</a> via libxml extension</li></ul> <div class="mw-heading mw-heading3"><h3 id="Python">Python</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=28" title="Edit section: Python"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li>The <a rel="nofollow" class="external text" href="https://docs.python.org/3/library/xml.etree.elementtree.html">ElementTree XML API</a> in the Python Standard Library includes <a rel="nofollow" class="external text" href="https://docs.python.org/3/library/xml.etree.elementtree.html#xpath-support">limited support</a> for XPath expressions</li> <li>libxml2</li> <li><a href="/w/index.php?title=Amara_(software)&action=edit&redlink=1" class="new" title="Amara (software) (page does not exist)">Amara</a></li> <li>Sedna XML Database</li> <li><a rel="nofollow" class="external text" href="http://lxml.de/">lxml</a></li> <li><a href="/wiki/Scrapy" title="Scrapy">Scrapy</a><sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup></li></ul> <div class="mw-heading mw-heading3"><h3 id="Ruby">Ruby</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=29" title="Edit section: Ruby"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/Libxml2" title="Libxml2">libxml2</a></li> <li><a href="/wiki/Nokogiri_(software)" title="Nokogiri (software)">Nokogiri</a></li></ul> <div class="mw-heading mw-heading3"><h3 id="Scheme">Scheme</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=30" title="Edit section: Scheme"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li>Sedna XML Database</li></ul> <div class="mw-heading mw-heading3"><h3 id="SQL">SQL</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=31" title="Edit section: SQL"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/MySQL" title="MySQL">MySQL</a> supports a subset of XPath from version 5.1.5 onwards<sup id="cite_ref-dev.mysql.com_2016_14-0" class="reference"><a href="#cite_note-dev.mysql.com_2016-14"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup></li> <li><a href="/wiki/PostgreSQL" title="PostgreSQL">PostgreSQL</a> supports XPath and XSLT from version 8.4 onwards<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup></li></ul> <div class="mw-heading mw-heading3"><h3 id="Tcl">Tcl</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=32" title="Edit section: Tcl"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li>The tDOM package provides a complete, compliant, and fast XPath implementation in C<sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup></li></ul> <div class="mw-heading mw-heading2"><h2 id="Use_in_schema_languages">Use in schema languages</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=33" title="Edit section: Use in schema languages"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>XPath is increasingly used to express constraints in schema languages for XML. </p> <ul><li>The (now <a href="/wiki/International_Organization_for_Standardization" title="International Organization for Standardization">ISO standard</a>) schema language <a href="/wiki/Schematron" title="Schematron">Schematron</a> pioneered the approach.</li> <li>A streaming subset of XPath is used in W3C XML Schema 1.0 for expressing uniqueness and key constraints. In XSD 1.1, the use of XPath is extended to support conditional type assignment based on attribute values, and to allow arbitrary Boolean assertions to be evaluated against the content of elements.</li> <li>XForms uses XPath to bind types to values.</li> <li>The approach has even found use in non-XML applications, such as the source code analyzer for Java called <a href="/wiki/PMD_(software)" title="PMD (software)">PMD</a>: the Java is converted to a <a href="/wiki/Document_Object_Model" title="Document Object Model">DOM</a>-like parse tree, then XPath rules are defined over the tree.</li></ul> <div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=34" title="Edit section: See also"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/XPath_3" title="XPath 3">XPath 3</a></li> <li><a href="/wiki/Navigational_database" title="Navigational database">Navigational database</a></li> <li><a href="/wiki/XLink" title="XLink">XLink</a></li> <li><a href="/wiki/XML_database" title="XML database">XML database</a></li> <li><a href="/wiki/Extensible_Stylesheet_Language" class="mw-redirect" title="Extensible Stylesheet Language">XSL</a></li> <li><a href="/wiki/XSL-FO" class="mw-redirect" title="XSL-FO">XSL-FO</a></li></ul> <div class="mw-heading mw-heading2"><h2 id="Notes">Notes</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=35" title="Edit section: Notes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1239543626">.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}</style><div class="reflist reflist-lower-alpha"> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text">XPath 2.0 supports atomic types, defined as built-in types in <a href="/wiki/W3C_XML_Schema" class="mw-redirect" title="W3C XML Schema">XML Schema</a>, and may also import user-defined types from a schema.</span> </li> <li id="cite_note-WalshAxisViz-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-WalshAxisViz_9-0">^</a></b></span> <span class="reference-text">XML authority Normal Walsh maintains an excellent online visualization of the axis specifiers.<sup id="cite_ref-Walsh1999_8-0" class="reference"><a href="#cite_note-Walsh1999-8"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> It appears from the illustration that <i>preceding</i>, <i>ancestor</i>, <i>self</i>, <i>descendant</i>, and <i>following</i> form a complete, ordered, non-overlapping partition of document element tree.</span> </li> <li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text">For a complete description, see <a rel="nofollow" class="external text" href="http://www.w3.org/TR/xpath">the W3C Recommendation document</a>.</span> </li> </ol></div></div> <div class="mw-heading mw-heading2"><h2 id="References">References</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=36" title="Edit section: References"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1239543626"><div class="reflist reflist-columns references-column-width reflist-columns-2"> <ol class="references"> <li id="cite_note-timelinehistory-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-timelinehistory_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-timelinehistory_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.dblab.ntua.gr/~bikakis/XML%20and%20Semantic%20Web%20W3C%20Standards%20Timeline-History.pdf">"XML and Semantic Web W3C Standards Timeline"</a> <span class="cs1-format">(PDF)</span>. 2012-02-04.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=unknown&rft.btitle=XML+and+Semantic+Web+W3C+Standards+Timeline&rft.date=2012-02-04&rft_id=http%3A%2F%2Fwww.dblab.ntua.gr%2F~bikakis%2FXML%2520and%2520Semantic%2520Web%2520W3C%2520Standards%2520Timeline-History.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFBergeron,_Randy2000" class="citation magazine cs1">Bergeron, Randy (2000-10-31). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20100726204716/http://www.sqlmag.com/article/xml/xpath-151-retrieving-nodes-from-an-xml-document.aspx">"XPath—Retrieving Nodes from an XML Document"</a>. <i>SQL Server Magazine</i>. Archived from <a rel="nofollow" class="external text" href="http://www.sqlmag.com/article/xml/xpath-151-retrieving-nodes-from-an-xml-document.aspx">the original</a> on 2010-07-26<span class="reference-accessdate">. Retrieved <span class="nowrap">2011-02-24</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=SQL+Server+Magazine&rft.atitle=XPath%E2%80%94Retrieving+Nodes+from+an+XML+Document&rft.date=2000-10-31&rft.au=Bergeron%2C+Randy&rft_id=http%3A%2F%2Fwww.sqlmag.com%2Farticle%2Fxml%2Fxpath-151-retrieving-nodes-from-an-xml-document.aspx&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFPierre_Geneves2012" class="citation web cs1"><a href="/wiki/Pierre_Geneves" title="Pierre Geneves">Pierre Geneves</a> (2012). <a rel="nofollow" class="external text" href="http://wam.inrialpes.fr/courses/PG-MoSIG12/xpath.pdf">"Course: The XPath Language"</a> <span class="cs1-format">(PDF)</span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=unknown&rft.btitle=Course%3A+The+XPath+Language&rft.date=2012&rft.au=Pierre+Geneves&rft_id=http%3A%2F%2Fwam.inrialpes.fr%2Fcourses%2FPG-MoSIG12%2Fxpath.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.w3.org/TR/xpath-30/">"XML Path Language (XPath) 3.0"</a>. <i>World Wide Web Consortium (W3C)</i>. 2014-04-02<span class="reference-accessdate">. Retrieved <span class="nowrap">2021-07-16</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=World+Wide+Web+Consortium+%28W3C%29&rft.atitle=XML+Path+Language+%28XPath%29+3.0&rft.date=2014-04-02&rft_id=https%3A%2F%2Fwww.w3.org%2FTR%2Fxpath-30%2F&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFKay2012" class="citation web cs1">Kay, Michael (2012-02-10). <a rel="nofollow" class="external text" href="https://archive.xmlprague.cz/2012/presentations/Whats_new_3.0_XPath_XSLT_XSD_1_1.pdf">"What's new in 3.0 (XSLT/XPath/XQuery) (plus XML Schema 1.1)"</a> <span class="cs1-format">(PDF)</span>. <i>XML Prague 2012</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2021-07-16</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=XML+Prague+2012&rft.atitle=What%27s+new+in+3.0+%28XSLT%2FXPath%2FXQuery%29+%28plus+XML+Schema+1.1%29&rft.date=2012-02-10&rft.aulast=Kay&rft.aufirst=Michael&rft_id=https%3A%2F%2Farchive.xmlprague.cz%2F2012%2Fpresentations%2FWhats_new_3.0_XPath_XSLT_XSD_1_1.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.w3.org/TR/xpath-31/">"XML Path Language (XPath) 3.1"</a>. <i>World Wide Web Consortium (W3C)</i>. 2017-03-21<span class="reference-accessdate">. Retrieved <span class="nowrap">2021-07-16</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=World+Wide+Web+Consortium+%28W3C%29&rft.atitle=XML+Path+Language+%28XPath%29+3.1&rft.date=2017-03-21&rft_id=https%3A%2F%2Fwww.w3.org%2FTR%2Fxpath-31%2F&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-Walsh1999-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-Walsh1999_8-0">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFWalsh1999" class="citation web cs1">Walsh, Norman (1999). <a rel="nofollow" class="external text" href="https://nwalsh.com/docs/tutorials/xsl/xsl/foil22.html">"Axis Specifiers"</a>. <i>nwalsh.com</i>. Personal blog of venerated XML sage graybeard<span class="reference-accessdate">. Retrieved <span class="nowrap">2021-02-25</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=nwalsh.com&rft.atitle=Axis+Specifiers&rft.date=1999&rft.aulast=Walsh&rft.aufirst=Norman&rft_id=https%3A%2F%2Fnwalsh.com%2Fdocs%2Ftutorials%2Fxsl%2Fxsl%2Ffoil22.html&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.oracle.com/javase/10/docs/api/javax/xml/xpath/package-summary.html">"javax.xml.xpath (Java SE 10 & JDK 10)"</a>. <i>Java® Platform, Standard Edition & Java Development Kit Version 10 API Specification</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2021-07-17</span></span>. <q>Since: 1.5</q></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=Java%C2%AE+Platform%2C+Standard+Edition+%26+Java+Development+Kit+Version+10+API+Specification&rft.atitle=javax.xml.xpath+%28Java+SE+10+%26+JDK+10%29&rft_id=https%3A%2F%2Fdocs.oracle.com%2Fjavase%2F10%2Fdocs%2Fapi%2Fjavax%2Fxml%2Fxpath%2Fpackage-summary.html&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.microsoft.com/en-us/dotnet/api/system.xml">"System.Xml Namespace"</a>. <i>Microsoft Docs</i>. 2020-10-25<span class="reference-accessdate">. Retrieved <span class="nowrap">2021-07-16</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=Microsoft+Docs&rft.atitle=System.Xml+Namespace&rft.date=2020-10-25&rft_id=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fapi%2Fsystem.xml&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFDuke2016" class="citation web cs1">Duke, Justin (2016-09-29). <a rel="nofollow" class="external text" href="https://www.digitalocean.com/community/tutorials/how-to-crawl-a-web-page-with-scrapy-and-python-3">"How To Crawl A Web Page with Scrapy and Python 3"</a>. <i><a href="/wiki/Digital_Ocean" title="Digital Ocean">Digital Ocean</a></i><span class="reference-accessdate">. Retrieved <span class="nowrap">2017-11-24</span></span>. <q>Selectors are patterns we can use to find one or more elements on a page so we can then work with the data within the element. scrapy supports either CSS selectors or XPath selectors.</q></cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=Digital+Ocean&rft.atitle=How+To+Crawl+A+Web+Page+with+Scrapy+and+Python+3&rft.date=2016-09-29&rft.aulast=Duke&rft.aufirst=Justin&rft_id=https%3A%2F%2Fwww.digitalocean.com%2Fcommunity%2Ftutorials%2Fhow-to-crawl-a-web-page-with-scrapy-and-python-3&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-dev.mysql.com_2016-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-dev.mysql.com_2016_14-0">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20160406093208/http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html">"MySQL :: MySQL 5.1 Reference Manual :: 12.11 XML Functions"</a>. <i>dev.mysql.com</i>. 2016-04-06. Archived from the original on 2016-04-06<span class="reference-accessdate">. Retrieved <span class="nowrap">2021-07-17</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=dev.mysql.com&rft.atitle=MySQL+%3A%3A+MySQL+5.1+Reference+Manual+%3A%3A+12.11+XML+Functions&rft.date=2016-04-06&rft_id=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.1%2Fen%2Fxml-functions.html&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span><span class="cs1-maint citation-comment"><code class="cs1-code">{{<a href="/wiki/Template:Cite_web" title="Template:Cite web">cite web</a>}}</code>: CS1 maint: unfit URL (<a href="/wiki/Category:CS1_maint:_unfit_URL" title="Category:CS1 maint: unfit URL">link</a>)</span></span> </li> <li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.postgresql.org/docs/8.4/xml2.html">"xml2"</a>. <i>PostgreSQL Documentation</i>. 2014-07-24<span class="reference-accessdate">. Retrieved <span class="nowrap">2021-07-16</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=PostgreSQL+Documentation&rft.atitle=xml2&rft.date=2014-07-24&rft_id=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2F8.4%2Fxml2.html&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> <li id="cite_note-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-16">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFLoewer2000" class="citation journal cs1">Loewer, Jochen (2000). <a rel="nofollow" class="external text" href="http://www.tdom.org/documents/tDOM3.pdf">"tDOM – A fast XML/DOM/XPath package for Tcl written in C"</a> <span class="cs1-format">(PDF)</span>. <i>Proceedings of First European TCL/Tk User Meeting</i><span class="reference-accessdate">. Retrieved <span class="nowrap">16 July</span> 2021</span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Proceedings+of+First+European+TCL%2FTk+User+Meeting&rft.atitle=tDOM+%E2%80%93+A+fast+XML%2FDOM%2FXPath+package+for+Tcl+written+in+C&rft.date=2000&rft.aulast=Loewer&rft.aufirst=Jochen&rft_id=http%3A%2F%2Fwww.tdom.org%2Fdocuments%2FtDOM3.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AXPath" class="Z3988"></span></span> </li> </ol></div> <div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=XPath&action=edit&section=37" title="Edit section: External links"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1235681985">.mw-parser-output .side-box{margin:4px 0;box-sizing:border-box;border:1px solid #aaa;font-size:88%;line-height:1.25em;background-color:var(--background-color-interactive-subtle,#f8f9fa);display:flow-root}.mw-parser-output .side-box-abovebelow,.mw-parser-output .side-box-text{padding:0.25em 0.9em}.mw-parser-output .side-box-image{padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .side-box-imageright{padding:2px 0.9em 2px 0;text-align:center}@media(min-width:500px){.mw-parser-output .side-box-flex{display:flex;align-items:center}.mw-parser-output .side-box-text{flex:1;min-width:0}}@media(min-width:720px){.mw-parser-output .side-box{width:238px}.mw-parser-output .side-box-right{clear:right;float:right;margin-left:1em}.mw-parser-output .side-box-left{margin-right:1em}}</style><style data-mw-deduplicate="TemplateStyles:r1237033735">@media print{body.ns-0 .mw-parser-output .sistersitebox{display:none!important}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}</style><div class="side-box side-box-right plainlinks sistersitebox"><style data-mw-deduplicate="TemplateStyles:r1126788409">.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}</style> <div class="side-box-flex"> <div class="side-box-image"><span class="noviewer" typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/d/df/Wikibooks-logo-en-noslogan.svg/40px-Wikibooks-logo-en-noslogan.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/d/df/Wikibooks-logo-en-noslogan.svg/60px-Wikibooks-logo-en-noslogan.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/d/df/Wikibooks-logo-en-noslogan.svg/80px-Wikibooks-logo-en-noslogan.svg.png 2x" data-file-width="400" data-file-height="400" /></span></span></div> <div class="side-box-text plainlist">Wikibooks has more on the topic of: <i><b><a href="https://en.wikibooks.org/wiki/Special:Search/XPath" class="extiw" title="wikibooks:Special:Search/XPath">XPath</a></b></i></div></div> </div> <ul><li><a rel="nofollow" class="external text" href="http://www.w3.org/TR/xpath10">XPath 1.0 specification</a></li> <li><a rel="nofollow" class="external text" href="http://www.w3.org/TR/xpath20/">XPath 2.0 specification</a></li> <li><a rel="nofollow" class="external text" href="http://www.w3.org/TR/xpath-30/">XPath 3.0 specification</a></li> <li><a rel="nofollow" class="external text" href="http://www.w3.org/TR/xpath-31/">XPath 3.1 specification</a></li> <li><a rel="nofollow" class="external text" href="http://www.xml.com/pub/a/2002/03/20/xpath2.html">What's New in XPath 2.0</a></li> <li><a rel="nofollow" class="external text" href="http://msdn.microsoft.com/en-us/library/ms256115.aspx">XPath Reference (MSDN)</a></li> <li><a rel="nofollow" class="external text" href="http://saxon.sourceforge.net/saxon6.5.5/expressions.html">XPath Expression Syntax (Saxon)</a></li> <li><a rel="nofollow" class="external text" href="http://saxon.sourceforge.net/saxon7.2/expressions.html">XPath 2.0 Expression Syntax (Saxon)</a>, <a rel="nofollow" class="external autonumber" href="http://saxon.sourceforge.net/saxon7.5/expressions.html">[1]</a></li> <li><a rel="nofollow" class="external text" href="https://developer.mozilla.org/en/Web/XPath">XPath - MDC Docs</a> by <a rel="nofollow" class="external text" href="https://developer.mozilla.org">Mozilla Developer Network</a></li> <li><a rel="nofollow" class="external text" href="http://www.data2type.de/en/xml-xslt-xslfo/xpath/xpath-introduction/">XPath introduction/tutorial</a></li> <li><a rel="nofollow" class="external text" href="http://www.data2type.de/en/xml-xslt-xslfo/xslt/xslt-xpath-function-reference/">XSLT and XPath function reference</a></li></ul> <div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}</style><style data-mw-deduplicate="TemplateStyles:r1236075235">.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}</style></div><div role="navigation" class="navbox" aria-labelledby="XSL" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1129693374"><style data-mw-deduplicate="TemplateStyles:r1239400231">.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}</style><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view"><a href="/wiki/Template:XSL" title="Template:XSL"><abbr title="View this template">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:XSL" title="Template talk:XSL"><abbr title="Discuss this template">t</abbr></a></li><li class="nv-edit"><a href="/wiki/Special:EditPage/Template:XSL" title="Special:EditPage/Template:XSL"><abbr title="Edit this template">e</abbr></a></li></ul></div><div id="XSL" style="font-size:114%;margin:0 4em"><a href="/wiki/XSL" title="XSL">XSL</a></div></th></tr><tr><td colspan="2" class="navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/XSLT" title="XSLT">XSLT</a> <ul><li><a href="/wiki/XSLT_elements" title="XSLT elements">elements</a></li></ul></li> <li><a href="/wiki/XSL_Formatting_Objects" title="XSL Formatting Objects">XSL-FO</a></li> <li><a class="mw-selflink selflink">XPath</a> <ul><li><a href="/wiki/XPath_1.0" class="mw-redirect" title="XPath 1.0">1.0</a></li> <li><a href="/wiki/XPath_2.0" title="XPath 2.0">2.0</a></li></ul></li></ul> </div></td></tr></tbody></table></div> <div class="navbox-styles"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1129693374"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236075235"></div><div role="navigation" class="navbox" aria-labelledby="World_Wide_Web_Consortium_(W3C)" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1129693374"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1239400231"><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view"><a href="/wiki/Template:W3C_standards" title="Template:W3C standards"><abbr title="View this template">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:W3C_standards" title="Template talk:W3C standards"><abbr title="Discuss this template">t</abbr></a></li><li class="nv-edit"><a href="/wiki/Special:EditPage/Template:W3C_standards" title="Special:EditPage/Template:W3C standards"><abbr title="Edit this template">e</abbr></a></li></ul></div><div id="World_Wide_Web_Consortium_(W3C)" style="font-size:114%;margin:0 4em"><a href="/wiki/World_Wide_Web_Consortium" title="World Wide Web Consortium">World Wide Web Consortium</a> (W3C)</div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Products and<br />standards</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"></div><table class="nowraplinks navbox-subgroup" style="border-spacing:0"><tbody><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/World_Wide_Web_Consortium#W3C_recommendation_(REC)" title="World Wide Web Consortium">Recommendations</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/ActivityPub" title="ActivityPub">ActivityPub</a></li> <li><a href="/wiki/Activity_Streams_(format)" title="Activity Streams (format)">Activity Streams</a></li> <li><a href="/wiki/WAI-ARIA" title="WAI-ARIA">ARIA</a></li> <li><a href="/wiki/Canonical_XML" title="Canonical XML">Canonical XML</a></li> <li><a href="/wiki/Compound_Document_Format" title="Compound Document Format">CDF</a></li> <li><a href="/wiki/CSS" title="CSS">CSS</a> <ul><li><a href="/wiki/CSS_animations" title="CSS animations">Animations</a></li> <li><a href="/wiki/CSS_Flexible_Box_Layout" title="CSS Flexible Box Layout">Flexbox</a></li> <li><a href="/wiki/CSS_grid_layout" title="CSS grid layout">Grid</a></li></ul></li> <li><a href="/wiki/Document_Object_Model" title="Document Object Model">DOM</a></li> <li><a href="/wiki/Efficient_XML_Interchange" title="Efficient XML Interchange">EXI</a></li> <li><a href="/wiki/Emotion_Markup_Language" title="Emotion Markup Language">EmotionML</a></li> <li><a href="/wiki/W3C_Geolocation_API" title="W3C Geolocation API">Geolocation API</a></li> <li><a href="/wiki/HTML" title="HTML">HTML</a> <ul><li><a href="/wiki/HTML5" title="HTML5">HTML5</a></li></ul></li> <li><a href="/wiki/Indexed_Database_API" title="Indexed Database API">IndexedDB</a></li> <li><a href="/wiki/Internationalization_Tag_Set" title="Internationalization Tag Set">ITS</a></li> <li><a href="/wiki/JSON-LD" title="JSON-LD">JSON-LD</a></li> <li><a href="/wiki/Linked_Data_Notifications" title="Linked Data Notifications">Linked Data Notifications</a></li> <li><a href="/wiki/MathML" title="MathML">MathML</a></li> <li><a href="/wiki/Micropub_(protocol)" title="Micropub (protocol)">Micropub</a></li> <li><a href="/wiki/Web_Ontology_Language" title="Web Ontology Language">OWL</a></li> <li><a href="/wiki/Pronunciation_Lexicon_Specification" title="Pronunciation Lexicon Specification">PLS</a></li> <li><a href="/wiki/Resource_Description_Framework" title="Resource Description Framework">RDF</a> <ul><li><a href="/wiki/RDF_Schema" title="RDF Schema">Schema</a></li></ul></li> <li><a href="/wiki/Semantic_Interpretation_for_Speech_Recognition" title="Semantic Interpretation for Speech Recognition">SISR</a></li> <li><a href="/wiki/Simple_Knowledge_Organization_System" title="Simple Knowledge Organization System">SKOS</a></li> <li><a href="/wiki/Synchronized_Multimedia_Integration_Language" title="Synchronized Multimedia Integration Language">SMIL</a></li> <li><a href="/wiki/SOAP" title="SOAP">SOAP</a></li> <li><a href="/wiki/Speech_Recognition_Grammar_Specification" title="Speech Recognition Grammar Specification">SRGS</a></li> <li><a href="/wiki/Subresource_Integrity" title="Subresource Integrity">SRI</a></li> <li><a href="/wiki/Speech_Synthesis_Markup_Language" title="Speech Synthesis Markup Language">SSML</a></li> <li><a href="/wiki/Scalable_Vector_Graphics" class="mw-redirect" title="Scalable Vector Graphics">SVG</a> <ul><li><a href="/wiki/SVG_filter_effects" title="SVG filter effects">Filter Effects</a></li></ul></li> <li><a href="/wiki/SCXML" title="SCXML">SCXML</a></li> <li><a href="/wiki/SHACL" title="SHACL">SHACL</a></li> <li><a href="/wiki/SPARQL" title="SPARQL">SPARQL</a></li> <li><a href="/wiki/Timed_text" title="Timed text">Timed text</a></li> <li><a href="/wiki/VoiceXML" title="VoiceXML">VoiceXML</a></li> <li><a href="/wiki/WebAssembly" title="WebAssembly">WebAssembly</a></li> <li><a href="/wiki/Web_of_Things" title="Web of Things">WoT</a> <ul><li><a href="/wiki/Thing_Description" title="Thing Description">TD</a></li></ul></li> <li><a href="/wiki/Web_storage" title="Web storage">Web storage</a></li> <li><a href="/wiki/Web_Services_Description_Language" title="Web Services Description Language">WSDL</a></li> <li><a href="/wiki/Webmention" title="Webmention">Webmention</a></li> <li><a href="/wiki/WebSub" title="WebSub">WebSub</a></li> <li><a href="/wiki/WebVTT" title="WebVTT">WebVTT</a></li> <li><a href="/wiki/Web_Open_Font_Format" title="Web Open Font Format">WOFF</a></li> <li><a href="/wiki/XHTML" title="XHTML">XHTML</a> <ul><li><a href="/wiki/XHTML%2BRDFa" title="XHTML+RDFa">+RDFa</a></li></ul></li> <li><a href="/wiki/XML" title="XML">XML</a> <ul><li><a href="/wiki/XML_Base" title="XML Base">Base</a></li> <li><a href="/wiki/XML_Encryption" title="XML Encryption">Encryption</a></li> <li><a href="/wiki/XML_Events" title="XML Events">Events</a></li> <li><a href="/wiki/XML_Information_Set" title="XML Information Set">Information Set</a></li> <li><a href="/wiki/XML_namespace" title="XML namespace">Namespace</a></li> <li><a href="/wiki/XML_Schema_(W3C)" title="XML Schema (W3C)">Schema</a></li> <li><a href="/wiki/XML_Signature" title="XML Signature">Signature</a></li> <li><a href="/wiki/XForms" title="XForms">XForms</a></li> <li><a href="/wiki/XInclude" title="XInclude">XInclude</a></li> <li><a href="/wiki/XLink" title="XLink">XLink</a></li> <li><a href="/wiki/XML-binary_Optimized_Packaging" title="XML-binary Optimized Packaging">XOP</a></li> <li><a class="mw-selflink selflink">XPath</a> <ul><li><a href="/wiki/XPath_2.0" title="XPath 2.0">2.0</a></li> <li><a href="/wiki/XPath_3" title="XPath 3">3.x</a></li></ul></li> <li><a href="/wiki/XPointer" title="XPointer">XPointer</a></li> <li><a href="/wiki/XProc" title="XProc">XProc</a></li> <li><a href="/wiki/XQuery" title="XQuery">XQuery</a></li> <li><a href="/wiki/XSL" title="XSL">XSL</a></li> <li><a href="/wiki/XSL_Formatting_Objects" title="XSL Formatting Objects">XSL-FO</a></li> <li><a href="/wiki/XSLT" title="XSLT">XSLT</a> <ul><li><a href="/wiki/XSLT_elements" title="XSLT elements">elements</a></li></ul></li></ul></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Notes</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/IndieAuth" title="IndieAuth">IndieAuth</a></li> <li><a href="/wiki/XAdES" title="XAdES">XAdES</a></li> <li><a href="/wiki/XBL" title="XBL">XBL</a></li> <li><a href="/wiki/XHTML%2BSMIL" title="XHTML+SMIL">XHTML+SMIL</a></li> <li><a href="/wiki/Extensible_User_Interface_Protocol" title="Extensible User Interface Protocol">XUP</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/World_Wide_Web_Consortium#Working_draft_(WD)" title="World Wide Web Consortium">Working drafts</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Call_Control_eXtensible_Markup_Language" title="Call Control eXtensible Markup Language">CCXML</a></li> <li><a href="/wiki/CURIE" title="CURIE">CURIE</a></li> <li><a href="/wiki/Encrypted_Media_Extensions" title="Encrypted Media Extensions">EME</a></li> <li><a href="/wiki/InkML" title="InkML">InkML</a></li> <li><a href="/wiki/Media_Source_Extensions" title="Media Source Extensions">MSE</a></li> <li><a href="/wiki/Rule_Interchange_Format" title="Rule Interchange Format">RIF</a></li> <li><a href="/wiki/SMIL_Timesheets" title="SMIL Timesheets">SMIL Timesheets</a></li> <li><a href="/wiki/SXBL" title="SXBL">sXBL</a></li> <li><a href="/wiki/WebGPU" title="WebGPU">WebGPU</a></li> <li><a href="/wiki/WebXR" title="WebXR">WebXR</a></li> <li><a href="/wiki/Extensible_Forms_Description_Language" title="Extensible Forms Description Language">XFDL</a></li> <li><a href="/wiki/XFrames" title="XFrames">XFrames</a></li> <li><a href="/wiki/XMLHttpRequest" title="XMLHttpRequest">XMLHttpRequest</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Guidelines</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Web_Content_Accessibility_Guidelines" title="Web Content Accessibility Guidelines">Web Content Accessibility Guidelines</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Initiative</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/W3C_Markup_Validation_Service" title="W3C Markup Validation Service">Markup Validation Service</a></li> <li><a href="/wiki/Web_Accessibility_Initiative" title="Web Accessibility Initiative">Web Accessibility Initiative</a></li> <li><a href="/wiki/Web_Components" title="Web Components">Web Components</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Deprecated</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/C-HTML" class="mw-redirect" title="C-HTML">C-HTML</a></li> <li><a href="/wiki/Handheld_Device_Markup_Language" title="Handheld Device Markup Language">HDML</a></li> <li><a href="/wiki/JavaScript_Style_Sheets" title="JavaScript Style Sheets">JSSS</a></li> <li><a href="/wiki/Precision_Graphics_Markup_Language" title="Precision Graphics Markup Language">PGML</a></li> <li><a href="/wiki/Vector_Markup_Language" title="Vector Markup Language">VML</a></li> <li><a href="/wiki/WebPlatform.org" title="WebPlatform.org">WebPlatform</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Obsoleted</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/P3P" title="P3P">P3P</a></li> <li><a href="/wiki/XHTML%2BMathML%2BSVG" title="XHTML+MathML+SVG">XHTML+MathML+SVG</a></li></ul> </div></td></tr></tbody></table><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Organizations</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"></div><table class="nowraplinks navbox-subgroup" style="border-spacing:0"><tbody><tr><td colspan="2" class="navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/World_Wide_Web_Foundation" title="World Wide Web Foundation">World Wide Web Foundation</a></li> <li><a href="/wiki/WHATWG" title="WHATWG">WHATWG</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Elected groups</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/w/index.php?title=W3C_Advisory_Board&action=edit&redlink=1" class="new" title="W3C Advisory Board (page does not exist)">AB</a></li> <li><a href="/w/index.php?title=W3C_Board&action=edit&redlink=1" class="new" title="W3C Board (page does not exist)">Board</a></li> <li><a href="/wiki/Technical_Architecture_Group" title="Technical Architecture Group">TAG</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Working groups</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/CSS_Working_Group" title="CSS Working Group">CSS</a></li> <li><a href="/wiki/SVG_Working_Group" title="SVG Working Group">SVG</a></li> <li><a href="/wiki/WebAssembly" title="WebAssembly">WebAssembly</a></li> <li><a href="/wiki/Web_Authentication_Working_Group" title="Web Authentication Working Group">WebAuthn</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Community & business groups</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Improving_Web_Advertising_Business_Group" title="Improving Web Advertising Business Group">Web Advertising BG</a></li> <li><a href="/wiki/WebAssembly" title="WebAssembly">WebAssembly</a> CG</li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Closed groups</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/W3C_Device_Description_Working_Group" title="W3C Device Description Working Group">Device Description</a> (DDWG)</li> <li><a href="/wiki/HTML_Working_Group" title="HTML Working Group">HTML</a></li> <li><a href="/wiki/W3C_MMI" title="W3C MMI">Multimodal Interaction Activity</a> (MMI)</li></ul> </div></td></tr></tbody></table><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Software</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"></div><table class="nowraplinks navbox-subgroup" style="border-spacing:0"><tbody><tr><td colspan="2" class="navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/CERN_httpd" title="CERN httpd">CERN httpd</a></li> <li><a href="/wiki/Libwww" title="Libwww">Libwww</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/Web_browser" title="Web browser">Browsers</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Line_Mode_Browser" title="Line Mode Browser">Line Mode</a> <span style="font-size:85%;">(1990–)</span></li> <li><a href="/wiki/Arena_(web_browser)" title="Arena (web browser)">Arena</a> <span style="font-size:85%;">(1993–98)</span></li> <li><a href="/wiki/Agora_(web_browser)" title="Agora (web browser)">Agora</a> <span style="font-size:85%;">(1994–97)</span></li> <li><a href="/wiki/Argo_(web_browser)" title="Argo (web browser)">Argo</a> <span style="font-size:85%;">(1994–97)</span></li> <li><a href="/wiki/Amaya_(web_editor)" title="Amaya (web editor)">Amaya</a> <span style="font-size:85%;">(browser/editor, 1996–2012)</span></li></ul> </div></td></tr></tbody></table><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Conferences</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/International_World_Wide_Web_Conference" class="mw-redirect" title="International World Wide Web Conference">International World Wide Web Conference</a> (IW3C) <ul><li><a href="/wiki/International_World_Wide_Web_Conferences_Steering_Committee" class="mw-redirect" title="International World Wide Web Conferences Steering Committee">Steering Committee</a> (IW3C2)</li> <li><a href="/wiki/First_International_Conference_on_the_World-Wide_Web" title="First International Conference on the World-Wide Web">First conference</a> ("WWW1", 1994)</li></ul></li></ul> </div></td></tr></tbody></table></div> <div class="navbox-styles"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1129693374"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236075235"></div><div role="navigation" class="navbox" aria-labelledby="Query_languages" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1129693374"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1239400231"><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view"><a href="/wiki/Template:Query_languages" title="Template:Query languages"><abbr title="View this template">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:Query_languages" title="Template talk:Query languages"><abbr title="Discuss this template">t</abbr></a></li><li class="nv-edit"><a href="/wiki/Special:EditPage/Template:Query_languages" title="Special:EditPage/Template:Query languages"><abbr title="Edit this template">e</abbr></a></li></ul></div><div id="Query_languages" style="font-size:114%;margin:0 4em"><a href="/wiki/Query_language" title="Query language">Query languages</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">In current use</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/.QL" title=".QL">.QL</a></li> <li><a href="/wiki/Alpha_(programming_language)" title="Alpha (programming language)">ALPHA</a></li> <li><a href="/wiki/Contextual_Query_Language" title="Contextual Query Language">CQL</a></li> <li><a href="/wiki/Cypher_(query_language)" title="Cypher (query language)">Cypher</a></li> <li><a href="/wiki/Data_Analysis_Expressions" title="Data Analysis Expressions">DAX</a></li> <li><a href="/wiki/Data_Mining_Extensions" title="Data Mining Extensions">DMX</a></li> <li><a href="/wiki/Datalog" title="Datalog">Datalog</a></li> <li><a href="/wiki/GraphQL" title="GraphQL">GraphQL</a></li> <li><a href="/wiki/Graph_Query_Language" title="Graph Query Language">Graph Query Language</a></li> <li><a href="/wiki/Gremlin_(query_language)" title="Gremlin (query language)">Gremlin</a></li> <li><a href="/wiki/ISBL" title="ISBL">ISBL</a></li> <li><a href="/wiki/Lightweight_Directory_Access_Protocol" title="Lightweight Directory Access Protocol">LDAP</a></li> <li><a href="/wiki/Language_Integrated_Query" title="Language Integrated Query">LINQ</a></li> <li><a href="/wiki/Molecular_Query_Language" title="Molecular Query Language">MQL</a></li> <li><a href="/wiki/MultiDimensional_eXpressions" title="MultiDimensional eXpressions">MDX</a></li> <li><a href="/wiki/Object_Query_Language" title="Object Query Language">OQL</a></li> <li><a href="/wiki/Object_Constraint_Language" title="Object Constraint Language">OCL</a></li> <li><a href="/wiki/QUEL_query_languages" title="QUEL query languages">QUEL</a></li> <li><a href="/wiki/RDF_query_language" title="RDF query language">RDF</a></li> <li><a href="/wiki/SMILES_arbitrary_target_specification" title="SMILES arbitrary target specification">SMARTS</a></li> <li><a href="/wiki/SPARQL" title="SPARQL">SPARQL</a></li> <li><a href="/wiki/SQL" title="SQL">SQL</a></li> <li><a href="/wiki/XQuery" title="XQuery">XQuery</a></li> <li><a class="mw-selflink selflink">XPath</a></li> <li><a href="/wiki/Yahoo!_Query_Language" class="mw-redirect" title="Yahoo! Query Language">YQL</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Proprietary</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Yahoo!_query_language" class="mw-redirect" title="Yahoo! query language">YQL</a></li> <li><a href="/wiki/Language_Integrated_Query" title="Language Integrated Query">LINQ</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Superseded</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/CODASYL" title="CODASYL">CODASYL</a></li></ul> </div></td></tr></tbody></table></div> <div class="navbox-styles"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1129693374"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236075235"></div><div role="navigation" class="navbox authority-control" aria-label="Navbox" style="padding:3px"><table class="nowraplinks hlist navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/Help:Authority_control" title="Help:Authority control">Authority control databases</a>: National <span class="mw-valign-text-top noprint" typeof="mw:File/Frameless"><a href="https://www.wikidata.org/wiki/Q16340#identifiers" title="Edit this at Wikidata"><img alt="Edit this at Wikidata" src="//upload.wikimedia.org/wikipedia/en/thumb/8/8a/OOjs_UI_icon_edit-ltr-progressive.svg/10px-OOjs_UI_icon_edit-ltr-progressive.svg.png" decoding="async" width="10" height="10" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/8/8a/OOjs_UI_icon_edit-ltr-progressive.svg/15px-OOjs_UI_icon_edit-ltr-progressive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/8/8a/OOjs_UI_icon_edit-ltr-progressive.svg/20px-OOjs_UI_icon_edit-ltr-progressive.svg.png 2x" data-file-width="20" data-file-height="20" /></a></span></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"><ul><li><span class="uid"><a rel="nofollow" class="external text" href="https://d-nb.info/gnd/4613223-5">Germany</a></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="https://id.loc.gov/authorities/sh2002000754">United States</a></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="https://catalogue.bnf.fr/ark:/12148/cb158976144">France</a></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="https://data.bnf.fr/ark:/12148/cb158976144">BnF data</a></span></li><li><span class="uid"><a rel="nofollow" class="external text" href="http://olduli.nli.org.il/F/?func=find-b&local_base=NLX10&find_code=UID&request=987007530334505171">Israel</a></span></li></ul></div></td></tr></tbody></table></div> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐f69cdc8f6‐2ms4s Cached time: 20241122143301 Cache expiry: 2592000 Reduced expiry: false Complications: [vary‐revision‐sha1, show‐toc] CPU time usage: 0.752 seconds Real time usage: 2.471 seconds Preprocessor visited node count: 4704/1000000 Post‐expand include size: 140884/2097152 bytes Template argument size: 18001/2097152 bytes Highest expansion depth: 27/100 Expensive parser function count: 72/500 Unstrip recursion depth: 1/20 Unstrip post‐expand size: 107266/5000000 bytes Lua time usage: 0.385/10.000 seconds Lua memory usage: 7669399/52428800 bytes Number of Wikibase entities loaded: 1/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 2308.416 1 -total 61.49% 1419.466 59 Template:Code 7.47% 172.542 2 Template:Reflist 5.67% 130.981 6 Template:Navbox 5.56% 128.394 11 Template:Cite_web 5.53% 127.608 2 Template:Infobox 4.83% 111.564 1 Template:Multiple_issues 4.70% 108.474 1 Template:XSL 4.23% 97.759 1 Template:Short_description 3.63% 83.811 1 Template:Infobox_programming_language --> <!-- Saved in parser cache with key enwiki:pcache:idhash:19086670-0!canonical and timestamp 20241122143301 and revision id 1236325233. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://en.wikipedia.org/w/index.php?title=XPath&oldid=1236325233">https://en.wikipedia.org/w/index.php?title=XPath&oldid=1236325233</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Help:Category" title="Help:Category">Categories</a>: <ul><li><a href="/wiki/Category:Query_languages" title="Category:Query languages">Query languages</a></li><li><a href="/wiki/Category:XML_data_access" title="Category:XML data access">XML data access</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Hidden categories: <ul><li><a href="/wiki/Category:CS1_maint:_unfit_URL" title="Category:CS1 maint: unfit URL">CS1 maint: unfit URL</a></li><li><a href="/wiki/Category:Articles_with_short_description" title="Category:Articles with short description">Articles with short description</a></li><li><a href="/wiki/Category:Short_description_is_different_from_Wikidata" title="Category:Short description is different from Wikidata">Short description is different from Wikidata</a></li><li><a href="/wiki/Category:Wikipedia_references_cleanup_from_March_2014" title="Category:Wikipedia references cleanup from March 2014">Wikipedia references cleanup from March 2014</a></li><li><a href="/wiki/Category:All_articles_needing_references_cleanup" title="Category:All articles needing references cleanup">All articles needing references cleanup</a></li><li><a href="/wiki/Category:Articles_covered_by_WikiProject_Wikify_from_March_2014" title="Category:Articles covered by WikiProject Wikify from March 2014">Articles covered by WikiProject Wikify from March 2014</a></li><li><a href="/wiki/Category:All_articles_covered_by_WikiProject_Wikify" title="Category:All articles covered by WikiProject Wikify">All articles covered by WikiProject Wikify</a></li><li><a href="/wiki/Category:Articles_needing_additional_references_from_August_2010" title="Category:Articles needing additional references from August 2010">Articles needing additional references from August 2010</a></li><li><a href="/wiki/Category:All_articles_needing_additional_references" title="Category:All articles needing additional references">All articles needing additional references</a></li><li><a href="/wiki/Category:Wikipedia_introduction_cleanup_from_May_2020" title="Category:Wikipedia introduction cleanup from May 2020">Wikipedia introduction cleanup from May 2020</a></li><li><a href="/wiki/Category:All_pages_needing_cleanup" title="Category:All pages needing cleanup">All pages needing cleanup</a></li><li><a href="/wiki/Category:Articles_covered_by_WikiProject_Wikify_from_May_2020" title="Category:Articles covered by WikiProject Wikify from May 2020">Articles covered by WikiProject Wikify from May 2020</a></li><li><a href="/wiki/Category:Articles_with_multiple_maintenance_issues" title="Category:Articles with multiple maintenance issues">Articles with multiple maintenance issues</a></li><li><a href="/wiki/Category:All_Wikipedia_articles_needing_clarification" title="Category:All Wikipedia articles needing clarification">All Wikipedia articles needing clarification</a></li><li><a href="/wiki/Category:Wikipedia_articles_needing_clarification_from_December_2015" title="Category:Wikipedia articles needing clarification from December 2015">Wikipedia articles needing clarification from December 2015</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 24 July 2024, at 02:50<span class="anonymous-show"> (UTC)</span>.</li> <li id="footer-info-copyright">Text is available under the <a href="/wiki/Wikipedia:Text_of_the_Creative_Commons_Attribution-ShareAlike_4.0_International_License" title="Wikipedia:Text of the Creative Commons Attribution-ShareAlike 4.0 International License">Creative Commons Attribution-ShareAlike 4.0 License</a>; additional terms may apply. By using this site, you agree to the <a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use" class="extiw" title="foundation:Special:MyLanguage/Policy:Terms of Use">Terms of Use</a> and <a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy" class="extiw" title="foundation:Special:MyLanguage/Policy:Privacy policy">Privacy Policy</a>. Wikipedia® is a registered trademark of the <a rel="nofollow" class="external text" href="https://wikimediafoundation.org/">Wikimedia Foundation, Inc.</a>, a non-profit organization.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:About">About Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:General_disclaimer">Disclaimers</a></li> <li id="footer-places-contact"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us">Contact Wikipedia</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/en.wikipedia.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//en.m.wikipedia.org/w/index.php?title=XPath&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-f69cdc8f6-g84kv","wgBackendResponseTime":141,"wgPageParseReport":{"limitreport":{"cputime":"0.752","walltime":"2.471","ppvisitednodes":{"value":4704,"limit":1000000},"postexpandincludesize":{"value":140884,"limit":2097152},"templateargumentsize":{"value":18001,"limit":2097152},"expansiondepth":{"value":27,"limit":100},"expensivefunctioncount":{"value":72,"limit":500},"unstrip-depth":{"value":1,"limit":20},"unstrip-size":{"value":107266,"limit":5000000},"entityaccesscount":{"value":1,"limit":400},"timingprofile":["100.00% 2308.416 1 -total"," 61.49% 1419.466 59 Template:Code"," 7.47% 172.542 2 Template:Reflist"," 5.67% 130.981 6 Template:Navbox"," 5.56% 128.394 11 Template:Cite_web"," 5.53% 127.608 2 Template:Infobox"," 4.83% 111.564 1 Template:Multiple_issues"," 4.70% 108.474 1 Template:XSL"," 4.23% 97.759 1 Template:Short_description"," 3.63% 83.811 1 Template:Infobox_programming_language"]},"scribunto":{"limitreport-timeusage":{"value":"0.385","limit":"10.000"},"limitreport-memusage":{"value":7669399,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-f69cdc8f6-2ms4s","timestamp":"20241122143301","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"XPath","url":"https:\/\/en.wikipedia.org\/wiki\/XPath","sameAs":"http:\/\/www.wikidata.org\/entity\/Q16340","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q16340","author":{"@type":"Organization","name":"Contributors to Wikimedia projects"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2008-08-29T10:17:29Z","dateModified":"2024-07-24T02:50:21Z","headline":"query language for selecting nodes from an XML document"}</script> </body> </html>