News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Chris Hartjes' Blog:
Reader Feedback Working with XML In PHP
August 28, 2008 @ 09:39:07

Chris Hartjes has answered some more questions his readers have asked in a new post to his blog today. This time the focus is on XML handling.

Welcome to the 3rd installment of me answering reader feedback questions. Today we deal with a topic that I deal with every day at my day job - working with XML in PHP.

He talks about SimpleXML (and how well it does its job) and their (his work's) current method of handling the storage of XML in a database. He describes both their current process and his ideal one, how he'd want to interface with their eXist backend.

0 comments voice your opinion now!
xml simplexml php5 exist database xquery xpath



Brian Moon's Blog:
Stupid PHP Tricks Normalizing SimpleXML Data
June 03, 2008 @ 09:34:22

Brian Moon has a "stupid PHP trick" posted to his blog today - normalizing SimpleXML data you've pulled in from just about any external source.

Anyhow, one annoying thing about SimpleXML has to do with caching. When using web services, we often cache the contents we get back. We were having a problem where we would get an error about a SimpleXML node not existing.

They were using memcache to store the information but came across problems when their code tried to use a (sometimes) empty tag. He gives two solutions - one using a recursive function that identifies the empty items and the other that encodes then decodes the object to and from JSON, keeping the values intact.

0 comments voice your opinion now!
trick stupid simplexml normalize json recursive empty tag


IBM developerWorks:
Process and integrate Google Notebook data with PHP
May 27, 2008 @ 12:05:23

A new tutorial over on the IBM developerWorks site (from Vikram Vaswani) shows how to pull data from the Google Notebook service into your script via the service's REST API.

Google Notebook is a free service that allows users to save and share notes and Web clippings in an online journal. A REST-based API allows developers to build customized PHP applications around this service using SimpleXML. In this article, you learn how to use the API, with examples of reading notebooks and notebook contents using PHP.

His method grabs the contents of the REST request and drops them into a SimpleXML object for easy manipulation. Different kinds of requests are included - getting the list of notebooks, getting the notebook's contents and how to add on extra parameters to the REST call to get more information in the responses.

0 comments voice your opinion now!
tutorial google notebook rest simplexml api


ThinkPHP Blog:
Accessing Nike+ data with PHP
May 15, 2008 @ 10:26:40

On the ThinkPHP blog today, Stephanie Ehrling has posted about a method for PHP to take in the output of the Nike+ equipment and put it into a usable form.

There is no official API that allows you to use the raw data. Nevertheless the data are sent to the Flash via XML so there is a chance to use them. For PHP Rasmus Lerdorf himself has implemented a class to access these data. The class allows to authenticate a user and fetch the running data of a user in a XML-Format

She gives an example of it in action - simple creation of an object then a call with the username and password. Behind the scenes, the data is pulled in and dropped into a SimpleXML object that includes total distance, total calories burned and data on the most recent run.

0 comments voice your opinion now!
nikeplus data xml simplexml class resmuslerdorf


Marco Tabini's Blog:
5 PHP 5 features you can't afford to ignore
April 29, 2008 @ 17:06:45

Marco Tabini has posted his list of what he considers five features of PHP5 that you "can't afford to ignore" when doing your development work:

Despite the fact that you may not have a choice in the matter, upgrading comes with a number of bonus new features that can help you write better code and gain access to new functionality that required a fair amount of hacking in previous version. Here's a quick list of 5 personal favourites.

The feature to make his list are SimpleXML, JSON/SOAP, PDO, the Standard PHP Library and SQLite. Each has their own bonus feature(s) included too for a little extra incentive to check them out.

0 comments voice your opinion now!
php5 feature list ignore simplexml json soap pdo spl sqlite


DevShed:
A Quick Overview of the XML DOM Extension in PHP 5
February 26, 2008 @ 12:26:00

DevShed has started up a new tutorial series today with part one of their overview of the DOM extension that's included with PHP5:

Simply put, the DOM XML extension, as its name suggests, will permit you to work on XML documents by way of the DOM API. [...] In this article series I'll be discussing some of its most relevant methods and properties and accompanying all of these explanations with concise and instructive hands-on examples.

They look at using the DOM to create new documents, modify documents by adding additional nodes and converting over a SimpleXML document to be manipulated.

0 comments voice your opinion now!
dom extension tutorial php5 build modify simplexml


Marco Tabini's Blog:
Thoughts for a new year PHP as the new Java
December 19, 2007 @ 13:47:00

Marco Tabini (of php|architect magazine) has posted some of his thoughts on why PHP just might be the "new Java" in the upcoming year.

Historically, PHP has been developed following the scratch-an-itch method [...]. This development process makes for some haphazard functionality, and has, in the past, been the source of many annoyances that need to be handled with extreme care.

He does mention some of the good things that have come out of this process like OOP in PHP4, SimpleXML functionality and type hinting but warns that if things swing too much the other way (planning out everything, only adding things by committee) that PHP might swerve towards a dangerous precedent - the Java community's mentality.

0 comments voice your opinion now!
java thought opinion oop php4 simplexml typehinting java thought opinion oop php4 simplexml typehinting


David Coallier's Blog:
Quick Tip - PHP, SimpleXML and CDATA
November 06, 2007 @ 11:16:00

David Coallier has shared a quick tip today about the PHP/SimpleXML/CDATA combination and the creation of auto-generated classes.

I thought, hey I wonder how long it'd take in php.. so I was working on it and I actually couldn't remember all those funny extra parameters in simplexml_* so if you are googling and cannot find something that says exactly what you want well here it is.

His example includes two additional parameters in his simplexml_load_string call to handle the CDATA section correctly and make accessing the data inside the block just like getting at anything else in the object.

Note that Rob Richards has also commented on the post that this issue was corrected a while back and it shouldn't be needed anymore, but could effect older versions of the SimpleXML functionality.

0 comments voice your opinion now!
simplexml cdata parameter extra simplexmlelement libxmlnocdata simplexml cdata parameter extra simplexmlelement libxmlnocdata


Make Me Pulse Blog:
Serialize and Unserialize SimpleXML in php
September 28, 2007 @ 09:30:00

From the "Make Me Pulse" blog (of Nicolas Rajabaly & Antoine Ughetto) there's a quick example of how to use serialized values with SimpleXML:

Serialize is useful for storing or passing PHP values around without losing type and structure. But if you want to serialize a SimpleXml object, you will have some problem on unserialize with the error. [...] Replacing SimpleXMLObject with stdClass is a good idea but in this solution we loose all of attributes, and how can we make simplexml->xpath after?

The solution? Serializing the XML content and then outputting it from the SimpleXML object as an XML string (to be stored). This process is reversed when the data is needed back out.

0 comments voice your opinion now!
serialize unserialize simplexml object xml store serialize unserialize simplexml object xml store


WebReference.com:
XML-Enabled Applications
September 17, 2007 @ 10:24:00

WebReference.com has an excerpt posted from one of Packt Publishing's latest PHP-related offerings, "PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax" (by Yuli Vasiliev). This specific chapter talks about XML-enabled applications and how PHP fits into the mix.

Both PHP and Oracle provide comprehensive support for XML and XML-related technologies. Practically, this means you can perform any XML processing either with PHP or inside an Oracle database. [...] This chapter explains how to effectively use XML techniques and technologies available in PHP and Oracle when building XML-enabled PHP/Oracle applications.

They cover the processing of XML in PHP/Oracle apps (including the SAX, DOM and SimpleXML methods), working with XPath and processing the XML in the other half of the two - Oracle's XML processing functionality.

Check out the Packt website for more information on the book.

1 comment voice your opinion now!
xml application oracle process simplexml dom sax xml application oracle process simplexml dom sax



Community Events











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


developer job ajax code zend application PHP5 package security database example release conference releases framework PEAR zendframework mysql cakephp book

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