Officially, XPath is a “query language” for XML. Let’s clarify exactly what that mean.
XPath is a sometimes cryptic string of characters we can use to search and extract data from XML documents with a great deal of specificity. If you are familiar with regular expressions, XPath is similar in concept—though not in syntax—in that you can build up powerful queries by putting together path expressions. This chapter introduces XPath concepts, although we won’t see how they look in PHP code until later chapters.
XPath is short for XML Path Language and was originally recommended by the W3C on November 16, 19991. It has since been revised, and the recommendation for XPath 2.0 was formalized December 14, 2010