NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL 5.1 Extractvalue() and PEAR XML_Serializer

csnyder chsnyder at gmail.com
Sat Jan 21 12:31:02 EST 2006


Jon Baer wrote in a couple weeks ago with news that MySQL 5.1 will
support extraction of values from XML fields using XPATH.
http://dev.mysql.com/tech-resources/articles/mysql-5.1-xml.html

That led me to think about ways in which this might be useful to PHP developers.

Which in turn led me to XML_Serializer (and unserializer) at
http://pear.php.net/package/XML_Serializer

Hmmm, select and update serialized php object properties in the database...

SELECT * FROM object WHERE extractvalue( object.xml, 
'/object/color/hue/blue' ) > 64;

SELECT extractvalue( UpdateXML( object.xml,
'/object/icon/href[self::text() = '/icons/xml.gif']'
,'<href>/icons/xml.png</href>' ),''/object/icon/href' ) FROM object;

Can't wait to try it.


--
Chris Snyder
http://chxo.com/


More information about the talk mailing list