News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
PHP DOM Using XPath
June 26, 2012 @ 08:16:08

On PHPMaster.com today there's a new tutorial showing you how to use the XPath functionality that's built into PHP's DOM functionality to query your XML.

In a recent article I discussed PHP's implementation of the DOM and introduced various functions to pull data from and manipulate an XML structure. I also briefly mentioned XPath, but didn't have much space to discuss it. In this article, we'll look closer at XPath, how it functions, and how it is implemented in PHP. You'll find that XPath can greatly reduce the amount of code you have to write to query and filter XML data, and will often yield better performance as well.

They start with some basic XPath queries to find a simple path and locating the record for a specific book. There's also an example of using XPath versus the "find" functions in the DOM functionality (like getElementsByTagName). There's also a bit close to the end about using functions in XPath and how you can pull back in PHP functionality and use native PHP functions in your XPath queries.

0 comments voice your opinion now!
xpath tutorial dom introduction


blog comments powered by Disqus

Similar Posts

Padraic Brady's Blog: ZF Blog App - Part 4: Design with Blueprint CSS & Zend_Layout

DevShed: Creating Image Streams from Existing Graphics with the GD Library in PHP

PHPBuilder.com: PHP and Shell Scripting: Using Pipes

Developer.com: Build Multi-lingual Websites With the Zend Framework

SitePoint.com: Sneak Peek at Kevin Yank's New Book 'PHP & MYSQL: Novice to Ninja'


Community Events





Don't see your event here?
Let us know!


zendserver series library install community laravel api opinion release update introduction interview deployment package framework podcast language tips symfony list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework