News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

MSBWare.com:
XML to Array
0 comments :: posted Monday April 14, 2008 @ 10:23:11
voice your opinion now!

Michael has posted a simple script today that takes in XML data and spits back out an array on the other side:

The function takes the specified XML data (which must be in valid XML format) and converts into an array. Any attributes in the XML elements are dropped an only the element values are placed in the array.

The code uses a combination of XPath, DOM, and regular expressions to parse the given XML content.

tagged with: xml translate array xpath dom regularexpression data element


Greg Szorc's Blog:
Using DTD's and Catalogs for XHTML Validation
0 comments :: posted Thursday April 10, 2008 @ 11:29:48
voice your opinion now!

Greg Szorc shows how, in this entry on his blog, to use DTDs and catalogs to validate your XHTML pages with a little help from PHP.

This [validation from an external site like the W3C validator] approach is a good start, but it is far from ideal because it is based on an honor system of sorts. You often forget to validate each change you make and there is always some corner case that you forget. So, what can be done about it? Well, if you find yourself developing in PHP, you can employ the following solution.

The code he includes pulls in the XHTML content from your page (or the output of the framework's view layer) and pushes it into a DOMDocument that's build with the LIBXML_DTDLOAD and LIBXML_DTDATTR options.

tagged with: html validation dom extension document import

DevShed:
Parsing Child Nodes with the DOM XML extension in PHP 5
0 comments :: posted Tuesday April 08, 2008 @ 09:47:48
voice your opinion now!

Alejandro Gervasio has finished up his series on DevShed looking at working with the DOM extension in PHP5 with this new article, a look at parsing child nodes.

In this last chapter of the series, I'm going to teach you how to handle the child nodes of an XML document by way of two simple methods, called hasChildNode() and removeChild() respectively. So let's not waste any more time in preliminaries and learn how to use them in a helpful way.

They review some of the concepts mentioned previously before moving ahead to the use of the hasChildNodes and removeChild methods to check for children and get rid of only certain ones.

tagged with: dom xml php5 tutorial child node haschildnodes removechild

DevShed:
Accessing Attributes and Cloning Nodes with the DOM XML Extension in PHP 5
0 comments :: posted Tuesday April 01, 2008 @ 15:11:43
voice your opinion now!

DevShed continues their series about working with XML in PHP's DOM extension with this new tutorial posted today showing how to get at attributes for tags and cloning nodes from others.

You've probably realized that the DOM XML library can be pretty useful when working with web documents. However, this extension includes some other methods, which can be utilized to parse attributes of a given XML string, as well as to clone nodes.

They show how to use the getAttributes method, hasAttribue method and cloneNode method to work with their XML examples.

tagged with: php5 clone node xml tutorial attribute node dom

DevShed:
Handling HTML Strings and Files with the DOM XML Extension in PHP 5
0 comments :: posted Wednesday March 26, 2008 @ 08:46:05
voice your opinion now!

On DevShed today, they continue their series looking at working with XML in PHP with the DOM functionality with the fifth part of their series, a look at working with HTML strings and file data.

Understanding how to use the methods and properties provided by this library requires a little effort from you, despite its fairly easy learning curve. [...] The DOM XML extension has plenty of options when it comes to moving portions of an XML document (or even the entire document) from one place to another. This is certainly a process that can be performed with minor hassles by utilizing the intuitive DOM API mentioned in the beginning.

They show how to use loadHTML to pull in the text from an HTML string and use loadHTMLFile to pull it in from an external HTML file. Finally, they show how to write the data and whatever changes you might have made to it, back out to a file with saveHTMLFile.

tagged with: tutorial dom extension xml handling html savehtmlfile loadhtml loadhtmlfile

DevShed:
Working with Multiple Document Nodes with the DOM XML Extension in PHP 5
0 comments :: posted Wednesday March 19, 2008 @ 07:59:49
voice your opinion now!

DevShed has posted the fourth part of their series looking at working with the DOM functionality of PHP5, this time with a focus on working with multiple document nodes inside of an XML document.

It's time to learn a few other methods included with the DOM XML extension. Based upon this premise, in this fourth tutorial I'm going to show you how to get access to multiple nodes of an XML document, either for internal processing or simply for echoing to the browser.

They show you how to grab the collection of nodes to work with and how to grab data from an XML text file with load() and loadXML().

tagged with: dom xml tutorial php5 load set collection object

DevShed:
Inserting Comments and Accessing Nodes with the DOM XML Extension in PHP 5
0 comments :: posted Tuesday March 11, 2008 @ 15:40:21
voice your opinion now!

DevShed continues their series looking at using the DOM extension in PHP5 to work with XML in your application. They've already looked at adding attributes and creating CDATA information in a new DOM document. This time they build on that and also include new methods - appending comment nodes and getting at XML nodes by their IDs.

I'm talking about the DOM XML extension, which allows you to handle XML documents by using the DOM API. Thus, if you're interested in learning how to put this extension to work for you quickly, look no further, because you've come to the right place. [...] In this third installment of the series, I'll be teaching you specifically how to append comment nodes to a given XML string and how to extract certain elements via their IDs.

They review the method to add attributes and CDATA to an XML document first. Then they cover the other two new topics - appending comment nodes and grabbing nodes by their ID attribute.

tagged with: dom extension php5 node cdata attribute id fetch tutorial

DevShed:
Working with Attributes and CDATA Sections with the DOM XML Extension
0 comments :: posted Wednesday March 05, 2008 @ 18:29:00
voice your opinion now!

DevShed has posted a new tutorial today that continues their series looking at XML handling with PHP. This time it's a focus on attributes in a CDATA section with DOM.

Since the DOM XML library comes equipped with many other methods that can be useful for adding custom attributes to the existing nodes of a given XML document, and creating new CDATA sections, among other things.

They start with a review of the DOM functionality to get you reacquainted. From there they move off into the createAttribute function and its use in the creation of CDATA elements in your XML.

tagged with: dom extension tutorial createelement cdata section

DevShed:
A Quick Overview of the XML DOM Extension in PHP 5
0 comments :: posted Tuesday February 26, 2008 @ 12:26:00
voice your opinion now!

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.

tagged with: dom extension tutorial php5 build modify simplexml

DeveloperTutorials.com:
Scraping Links With PHP
0 comments :: posted Monday January 14, 2008 @ 08:44:00
voice your opinion now!

The Developer Tutorials site has posted a new article covering the creation of a small application that can help you scrape content from a remote page and pull it into your script.

In this tutorial you will learn how to build a PHP script that scrapes links from any web page.

You'll learn to use cURL, the DOM functions, XPath and a bit of MySQL to get the job done. It's nice to see that they also include a section looking at one of the more touchy aspects of web page scraping - "is it legal?"

tagged with: scraping webpage remote curl xpath dom mysql scraping webpage remote curl xpath dom mysql


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

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