News Feed
Sections




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

Working Software Blog:
Escaping single and double quotes for use with XPath queries in PHP
August 19, 2011 @ 13:50:14

On the Working Software blog there's a new post showing a solution to a issue with escaping quotes in XPath queries that's not just an issue in PHP.

I've been working with the Basecamp API to plugin our IRC bot that we use for time tracking and I'm astounded to learn that escaping single and/or double quotes for XPath queries in PHP does not have a well documented, best practices solution. In fact, it seems as though this is not peculiar to PHP. I took a look around and found this excellent article by "Kushal": http://kushalm.com/the-perils-of-xpath-expressions-specifically-escaping-quotes.

He's put together his own (PHP) solution to the problem - running the entire XPath query through a filtering method that splits it up, replaces the quote characters and combines it back down to a single string.

0 comments voice your opinion now!
escape quote double single xpath query tutorial


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: Using XML, Part 5 - SOAP and WSDL

SitePoint PHP Blog: Automate PHP with Phake Real World Examples

SitePoint Web Tech Blog: How To Create Friendlier Random Passwords

Gennady Feldman's Blog: Installing Oracle Instant Client 11g and PECL OCI8 (Part 2)

PHPBuilder.com: Import MS Access Data to MySQL 5


Community Events

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


interview community language configure api framework series introduction install conference symfony2 laravel performance part2 php7 application podcast release opinion example

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