News Feed
Sections




News Archive
feed this:

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

DZone.com:
Guidelines for generating XML
July 15, 2010 @ 11:50:44

On DZone.com there's a recent post from Evert Pot talking about some guidelines for generating XML including a brief PHP example.

Over the last little while I've come across quite a few XML feed generators written in PHP, with varying degrees of 'correctness'. Even though generating XML should be very simple, there's still quite a bit of pitfalls I feel every PHP or (insert your language)-developer should know about.

His suggestions for better XML include:

  • You are better off using an XML library (like xmlwriter)
  • Understand Unicode
  • CDATA is never a solution
  • Be verbose
  • Be careful with entities
0 comments voice your opinion now!
guideline generate xml xmlwriter suggestion


PHPBuilder.com:
A Quick PHP XMLWriter Class Tutorial XML & RSS
January 19, 2009 @ 11:19:52

The PHPBuilder.com has posted today looking to introduce you to a powerful XML creation tool in PHP5 installations - XMLWriter.

They jump right in and show it in action by creating a simple RSS document with one element inside. A call to the flush() method on your XMLWriter object is all it takes to output the XML.

They also change things up and bit and swap out the procedural code for a more object-oriented approach with a constructor that sets up the object and adds in some of the common RSS information. Their addItem() method is called to add in a sample item (in this case, an entry for a CD player product) and _endRSS() closes things off and runs that flush() to send it all back out.

You can find out more about XMLWriter (and its sister, XMLReader) in the PHP manual.

0 comments voice your opinion now!
xmlwriter tutorial rss class oop php5 xmlreader


Zend Developer Zone:
XML and PHP 5
August 01, 2007 @ 10:13:00

The Zend Developer Zone has a new tutorial posted looking at PHP5 and the new XML tools that it has to offer - as broken up into categories:

Things are a bit different using XML in PHP 5. In a similar scenario, you could use one of the new native extensions, like DOM or SimpleXML, to manipulate the XML data tree. This tree can then be passed directly to and used by the XSL extension without incurring any additional overhead. There is no serialization nor copying involved; ext/xsl is able to work directly with the XML tree it is given, resulting in a significant improvement in use of system resources as compared to coding a similar task in PHP 4. So now that you have an idea why XML support got a face lift, you might like to know about the different tools available to you.
0 comments voice your opinion now!
xml php5 tutorial introduction dom xsl xmlreader xmlwriter simplexml xml php5 tutorial introduction dom xsl xmlreader xmlwriter simplexml


Community News:
Livedocs XMLWriter Entry Updated
January 03, 2007 @ 16:55:00

As mentioned briefly by Pierre-Alain Joye, the documentation (on the Livedocs website) has been updated for the XMLWriter package.

This is the XMLWriter extension. It wraps the libxml xmlWriter API.

This extension represents a writer that provides a non-cached, forward-only means of generating streams or files containing XML data. This extension can be used in an object oriented style or a procedural one. Every method documented describes the alternative procedural call.

The updated documentation cn be found here.

0 comments voice your opinion now!
livedocs xmlwriter extension update livedocs xmlwriter extension update


Pierre's Blog:
XMLWriter in PHP 5.1.2
December 07, 2005 @ 07:35:02

From Pierre today, there's this quick post concerning the inclusion of XMLWriter in PHP 5.1.2.

XMLWriter is finally bundled in php5. It will available and enabled by default in the next PHP release (5.1.2).

With XMLReader, XMLWriter is a really nice addition to the xml extensions.

The XMLWriter extension provides fast, non-cached, forward-only means of generating streams or files containing XML data.

0 comments voice your opinion now!
xmlwriter 5.1.2 included xmlwriter 5.1.2 included



Community Events





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


security library opinion series update composer interview introduction install version package podcast tool voicesoftheelephpant framework laravel language symfony release community

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