-
Book Overview & Buying
-
Table Of Contents
PHP jQuery Cookbook
By :
XPath or the XML Path is used to navigate an XML document. It is basically a query language that provides a standard set of expressions and functions for traversing a document tree. XPath operates on a document tree and can be used for functions, such as searching, comparing, and so on in a document.
PHP has built-in support for using XPath. This recipe will explain some concepts of XPath and how they can be used to get information from XML.
Using the common.xml file we will write a simple example that will demonstrate the capabilities of XPath.
Like earlier recipes, create a separate folder named Recipe3 inside the Chapter3 directory.
Create an HTML file and name it as index.html. Create four buttons that will be used to show different usage of XPath. Also, create an empty DIV element for displaying the result. Also, define some CSS in the <head> section for better display.
<html>
<head>
<title>Using XPath...
Change the font size
Change margin width
Change background colour