 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
James Morris' Blog: Parsing HTML with DOMDocument and DOMXPathQuery
by Chris Cornutt June 27, 2012 @ 10:19:35
In the latest post to his blog James Morris looks at using XPath's query() function to locate pieces of data in your XML.
The other day I needed to do some html scraping to trim out some repeated data stuck inside nested divs and produce a simplified array of said data. My first port of call was SimpleXML which I have used many times. However this time, the son of a bitch just wouldn't work with me and kept on throwing up parsing errors. I lost my patience with it and decided to give DomDocument and DOMXpath a go which I'd heard of but never used.
He includes a code (and XML document) example showing how to extract out some content from an HTML structure - grabbing each of the images from inside a div and associating them with their description content.
voice your opinion now!
dom domdocument domxpath xpath tutorial html
PHPMaster.com: PHP DOM Using XPath
by Chris Cornutt June 26, 2012 @ 08:16:08
On PHPMaster.com today there's a new tutorial showing you how to use the XPath functionality that's built into PHP's DOM functionality to query your XML.
In a recent article I discussed PHP's implementation of the DOM and introduced various functions to pull data from and manipulate an XML structure. I also briefly mentioned XPath, but didn't have much space to discuss it. In this article, we'll look closer at XPath, how it functions, and how it is implemented in PHP. You'll find that XPath can greatly reduce the amount of code you have to write to query and filter XML data, and will often yield better performance as well.
They start with some basic XPath queries to find a simple path and locating the record for a specific book. There's also an example of using XPath versus the "find" functions in the DOM functionality (like getElementsByTagName). There's also a bit close to the end about using functions in XPath and how you can pull back in PHP functionality and use native PHP functions in your XPath queries.
voice your opinion now!
xpath tutorial dom introduction
PHPMaster.com: PHP DOM Working with XML
by Chris Cornutt June 08, 2012 @ 08:27:45
On PHPMaster.com there's a new tutorial posted about using XML in PHP, an introduction to using the DOM functionality in PHP to work with your XML content.
PimpleXML allows you to quickly and easily work with XML documents, and in the majority of cases SimpleXML is sufficient. But if you're working with XML in any serious capacity, you'll eventually need a feature that isn't supported by SimpleXML, and that's where the PHP DOM (Document Object Model) comes in.
He starts with a brief introduction to XML and DTDs including an example of each (defining a sample book information he'll use in the rest of the tutorial). He helps you create a simple class that takes in the XML content, working with construction/destruction of the object and using it to find, add and delete a book by things like ISBN or genre.
voice your opinion now!
dom tutorial introduction xml
PHPBuilder.com: PHP Simple HTML DOM Parser Editing HTML Elements in PHP
by Chris Cornutt September 08, 2011 @ 10:06:07
On PHPBuilder.com today there's a new tutorial from Vojislav Janjic about using a simple DOM parser in PHP to edit the markup even if it's not correctly W3C-formatted - the Simple HTML DOM Parser
Simple HTML DOM parser is a PHP 5+ class which helps you manipulate HTML elements. The class is not limited to valid HTML; it can also work with HTML code that did not pass W3C validation. Document objects can be found using selectors, similar to those in jQuery. You can find elements by ids, classes, tags, and much more. DOM elements can also be added, deleted or altered.
They help you get started using the parser, passing in the HTML content to be handled (either directly via a string or loading a file) and locating elements in the document either by ID, class or tag. Selectors similar to those in CSS are available. Finally, they show how to find an object and update its contents, either by adding more HTML inside or by appending a new object after it.
voice your opinion now!
simple html dom parse tutorial selector find replace edit
PHPBuilder.com: Parsing XML with the DOM Extension for PHP 5
by Chris Cornutt October 28, 2010 @ 14:47:56
On PHPBuilder.com there's a new tutorial from Octavia Anghel about using the DOM extension to parse XML in a PHP5 application. The DOM functionality makes it simpler than even the older PHP4 DOM functionality to work with XML messaging and documents.
DOM (Document Object Model) is a W3C standard based on a set of interfaces, which can be used to represent an XML or HTML document as a tree of objects. A DOM tree defines the logical structure of documents and the way a document is accessed and manipulated. Using DOM, developers create and build XML or HTML documents, navigate their structures, and add, modify, or delete elements and content. The DOM can be used with any programming language, but in this article we will use the DOM extension for PHP 5. This extension is part of the PHP core and doesn't need any installation.
They include both a sample XML file to parse and the code you'll need to pull it in and make a basic DOM object out of it. Also included is some code showing how to pull out certain pieces of information, recurse through a set of XML values, add new nodes to the structure, remove a node and more.
voice your opinion now!
parse xml dom extension tutorial
Qafoo.com: Practical PHPUnit Testing XML generation
by Chris Cornutt September 17, 2010 @ 13:51:02
On the Qafoo blog today there's a new post from Tobias Schlitt about a method you can use to unit test methods that generate XML without messing with a lot of extra overhead just to test the results.
Testing classes which generate XML can be a cumbersome work. At least, if you don't know the right tricks to make your life easier. In this article, I will throw some light upon different approaches and show you, how XML generation can be tested quite easily using XPath.
He includes a sample class, qaPersonVisitor, that has methods inside it to create a simple XML documents based on the first and last name data into a DOM element. He sets up the basic test case that creates a simple person - including gender and date of birth - and offer a few different suggestions on handling the check (in PHPUnit tests):
- the naive way of rebuilding the DOM object and assert that they are equal
- testing the resulting XML from the DOM object against a pre-generated XML document
- matching the contents via CSS selectors
- using the tag matching assertions
- using XPath in a custom assertion (with short and long uses of it included)
voice your opinion now!
unittest phpunit xml generation xpath dom
Thomas Weinert's Blog: Using PHP DOM With XPath
by Chris Cornutt April 13, 2010 @ 13:18:32
Thomas Weinert has a recent post to his blog showing how to use one of the more powerful XML-handling features that PHP's DOM extension includes - XPath.
Often I hear people say "We use SimpleXML, because DOM is so noisy and complex". Well, I don't think so. This article explains how you can parse a XML (an Atom feed) using the PHP DOM extension. No other libraries are involved.
In his example he loads an external feed (his own) into a DOM object, blocks any errors with a few handy functions and creates a DOMXPath object on the DOM object to get ready for his queries. He shows how to make searches for titles, subtitles, looping over attributes and an element list returned from one of the first queries. A full code listing is also provided to show how it all fits together.
voice your opinion now!
dom xpath domxpath tutorial search atom
Zend Developer Zone: PHP DOM XML extension encoding processing
by Chris Cornutt September 02, 2009 @ 09:48:18
On the Zend Developer Zone today Alexander Veremyev shares some helpful hints he discovered about the DOM XML extension for PHP that could come in handy when working with different character encodings.
I recently worked with PHP's DOM XML extension while working on Zend Framework's Zend_Search_Lucene HTML highlighting capabilities, and uncovered some undocumented features and issues with the extension in regards to character encoding. The information contained in this article should also apply to other libxml-based DOM implementations, as PHP's DOM extension simply wraps that library.
There's five different tips he shares:
- Internal document encoding is always UTF-8
- Input data is always treated as UTF-8
- Text nodes and CDATA are stored as UTF-8 without transformations
- Document encoding does not affect loading behavior
- Save/dumping operations and encoding
He describes each of the points and includes some sample code and XML to parse to help illustrate each.
voice your opinion now!
tutorial dom extension character encoding
PHPro.org: Dynamically Create Menu With PHP DOM
by Chris Cornutt July 20, 2009 @ 10:50:52
New from Kevin Waterson on the PHPro.org site is this tutorial looking at dynamically making a website menu with PHP's DOM functionality.
Most PHP coders will have their own menu generation class that will take an array or an item and add it to a HTML un-ordered list or other tag and the styling is handled with CSS. This has proven to be a worthy solution to menu creation, however, PHP already has all the tools and classes built in to create a menu using DOM. It is both powerful and extensible and further eliminates for yet another class in your tree.
The tutorial shows you how to create a simple XML document to define the menu using the DOM functionality in PHP and finally output it as a series of unordered lists that can be styled in whatever way you want.
voice your opinion now!
xml dom menu dynamic
Content with Style: Remove nodes in SimpleXMLElement
by Chris Cornutt July 16, 2009 @ 11:15:57
The Content with Style blog has this quick tip on removing nodes from inside of a SimpleXML object without causing problems with its internal handling.
You might think otherwise and hack it with unset(), as it was done in one of the web applications I inherited at work, but today I found out that this works under some conditions, but not with every setup. I'd love to tell you what exactly the differences are that make it break, but I didn't spend the time tracking it down.
Instead, he suggests a call to dom_import_simplexml to swap the object over to the DOM, performing a removeChild on the node and pushing it back over to SimpleXML if the need's there.
voice your opinion now!
removechild dom tutorial simplexml
Thomas Weinert's Blog: FluentDOM
by Chris Cornutt June 12, 2009 @ 07:59:13
Thomas Weinert has posted about a new tool he's worked up to make working with the DOM in PHP a bit more fluent - FluentDOM.
Today I like to present a new projekt: FluentDOM. It provides an easy to use, jQuery like, fluent interface for DOMDocument. The idea was born in a workshop of Tobias Schlitt about the PHP XML extensions at the IPC Spring in Berlin.
He includes a basic code example - locating items with an ID of "first" and removing that ID to replace it with a class. If you'd like to check it out (literally) you can grab the latest version from the project's public svn.
voice your opinion now!
jquery xml dom fluentdom
Stoyan Stefanov's Blog: Blog-to-podcast with ffmpeg
by Chris Cornutt February 16, 2009 @ 08:45:52
Stoyan Stefanov has an interesting way to "automatically" create podcasts based on your blog posts using PHP, ffmpeg and the "say" command in OS X to create the mp3 result.
ffmpeg is such an amazing tool, looks like it's for video what ImageMagick is for images. An all-powerful all-formats wicked cool command-line tool. This blog post is an introduction to some of the MP3 capabilities of ffmpeg. I'll use ffmpeg to transform a blog post into a podcast-ready mp3 file.
The post shows how to use PHP's DOM functions to grab the title and contents of your post (a simple example, at least) and push that information out to a text file. From there, the "say" command is run on it with the "output" file parameter and the result is sent to ffmpeg for compression into an mp3.
voice your opinion now!
ffmpeg say osx dom blog podcast convert automatic mp3
PHP in Action: Get links with XPath
by Chris Cornutt October 07, 2008 @ 08:43:33
In response to this tutorial over on the PHPro.org website a new post has been made to the PHP in Action blog with an "even cooler" way to do the same sort of DOM fetching - XPath.
I'm a little bit surprised at the claim [the tutorial makes] that it's the "correct" (only) way, since there's at least one more that I find even cooler: XPath. Admittedly, it's slower, yet it's a more powerful language.
A quick example is included, building up from a simple search for anchor tags up to a custom query looking for just the anchor tags with a class of "bookmark".
voice your opinion now!
xpath tutorial dom link find search anchor attribute
PHPPro.org: SQL Intro, Reciprocal Links & Finding Links with DOM
by Chris Cornutt October 06, 2008 @ 12:09:15
Kevin Waterson has added three new tutorials to his PHPPro.org website recently:
- Introduction To SQL - The language used in relational databases is SQL. Regardless of the database used, a standard language is used to communicate with them all. This tutorial shows some basic concepts to using SQL.
- Reciprocal Links - Automating reciprocal links at first glance looks a daunting task. This helper class takes away much of the pain of what can be a mindlessly tedious process and simplifies it into a few easy to use class methods
- Get Links With DOM - Perhaps the biggest mistake people make when trying to get URLs or link text from a web page is trying to do it using regular expressions. The job can be done with regular expressions, however, there is a high overhead in having preg loop over the entire document many times. The correct way, and the faster, and infinitely cooler ways is to use DOM.
You can find the links to these and many other great tutorials over on the PHPPro.org website's tutorials section.
voice your opinion now!
tutorial sql intro reciprocal link dom find
SitePoint PHP Blog: DOM vs. Template
by Chris Cornutt September 25, 2008 @ 11:18:25
In this new post to the SitePoint PHP Blog there's a look at using a small templating engine recently released by Fredrik Holmstrom that takes a different tack on working with template files - it parses them into a DOM structure.
The main difference to traditional template engines (Such as Smarty), is that the template it self doesn't have any imperatives within. In fact, the template doesn't even have to be written to the template engine, to be used - Any markup can be used as a source.
The templating system uses Domlings, bits of HTML to match against and replace with the bound information. A few examples are included - a simple binding, how to switch out a block of HTML, pushing it back in and looping over a block of information to do some search and replace.
voice your opinion now!
dom template smarty domlings html replace
Developer Tutorials Blog: Easy Screen Scraping in PHP with the Simple HTML DOM Library
by Chris Cornutt August 06, 2008 @ 08:40:15
On the Developer Tutorials blog today Akash Mehta looks at screen scraping using a simple DOM library to help make it easy.
In PHP, regular expressions tend to get rather messy, DOM calls can be confusing and verbose, and often the string functions just aren't enough. In this tutorial, I'll show you how to use the middle ground - the open source PHP Simple HTML DOM Parser library, which provides jQuery-grade awesomeness for easy screen scraping without messy regular expressions.
In his examples he shows how to grab the contents of a page (google.com), find and replace information in the HTML and perform a query on the data (like finding each of the news stories out of the front page of slashdot.org).
voice your opinion now!
screen scraping simple html dom library example tutorial
Kae Verans' Blog: innerHTML in php-dom
by Chris Cornutt July 28, 2008 @ 11:13:16
Kae Verans has written up a handy snippet of code to try to mimic the innerHTML property that Javascript lets you have access to.
DOM does not officially have an innerHTML parameter, but it's incredibly useful. I found a need for something similar when working on some DOM stuff, so had to write a version.
Technically it's an "outerHTML" not inner, but it works about the same. The code and an example of its use is included.
voice your opinion now!
innrehtml outerhtml dom snippet example
SitePoint PHP Blog: Mangling XML as Text with PHP DOM
by Chris Cornutt July 24, 2008 @ 09:35:16
In trying to convert over several HTML pages to the DITA XML format, James Edwards came up against a problem involving recursion:
But a problem I came across several times was the sheer complexity of recursive element conversion '" <code> becomes <jsvalue> (or one of a dozen similar elements), <a> becomes <xref> '¦ and that's all simple enough; but each of these elements might contain the other, or further child elements like <em>, and as we walk through the DOM so the incidence of potential recursion increases, until it gets to the point where my brain explodes.
His solution involves working with both regular expressions and document fragments. He loads the node he wants to work with, its parsed to prepare it and is passed off to do the "text-based mangling" to update it. The result is them pushed back into an XML object (fragment) and this is pushed back into the main document with a replaceChild call.
voice your opinion now!
dom xml convert dita replacechild fragment node tutorial
Greg Szorc's Blog: Using DTD's and Catalogs for XHTML Validation
by Chris Cornutt April 10, 2008 @ 11:29:48
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.
voice your opinion now!
html validation dom extension document import
DevShed: Handling HTML Strings and Files with the DOM XML Extension in PHP 5
by Chris Cornutt March 26, 2008 @ 08:46:05
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.
voice your opinion now!
tutorial dom extension xml handling html savehtmlfile loadhtml loadhtmlfile
DevShed: Inserting Comments and Accessing Nodes with the DOM XML Extension in PHP 5
by Chris Cornutt March 11, 2008 @ 15:40:21
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.
voice your opinion now!
dom extension php5 node cdata attribute id fetch tutorial
WebReference.com: XML-Enabled Applications
by Chris Cornutt 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.
voice your opinion now!
xml application oracle process simplexml dom sax xml application oracle process simplexml dom sax
MakeBeta Blog: Scraping Links With PHP
by Chris Cornutt August 15, 2007 @ 12:08:00
From Justin Laing over at Merchant OS there's a new tutorial on creating a simple link scraper with the help of PHP and the cURL extension.
In this tutorial you will learn how to build a PHP script that scrapes links from any web page. You learn how to use cURL, call PHP DOM functions, use XPath and store the links in MySQL.
You'll have to have PHP5 and the cURL extension enabled on your web server to make it all work, but the code is all there ready for you to cut and paste. The application grabs the page with cURL (including the possibility to fake your user agent), parses through the HTML with the DOM and XPath functionality to grab the links and uses the MySQL methods to store them into your database.
voice your opinion now!
scrape link curl dom xpath mysql tutorial scrape link curl dom xpath mysql tutorial
Zend Developer Zone: XML and PHP 5
by Chris Cornutt 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.
voice your opinion now!
xml php5 tutorial introduction dom xsl xmlreader xmlwriter simplexml xml php5 tutorial introduction dom xsl xmlreader xmlwriter simplexml
AxisVista Blog: PHP5 DOM Based Template Engine
by Chris Cornutt July 26, 2007 @ 10:22:00
On the AxisVista blog, there's a new tutorial looking at the creation of a PHP5 DOM-based templating engine that makes it easier for designers to work with a site and not have to know PHP to do so.
At the office today, I had a talk with our designers, so they want a "designer-friendly" template engine. Sounds easy, but it isn't. That is why I decided to write this very short post to help others having such "easy" problems.
First he lays out the requirements for the project, then heads off to Google to see if there's anything similar. He found PRADO but it still lacked some of what he needed. So, deciding on developing his own Templating system, he creates a system that supports:
- Caching
- WYSIWYG & Dynamic Tag Handlers
- States
- PHP Tags
The code (and results) are included in the post, both in code blocks and for download.
voice your opinion now!
template engine php5 dom xml designer template engine php5 dom xml designer
PHPBuilder.com: Using XML - Part 6 Validation
by Chris Cornutt July 20, 2006 @ 09:46:37
PHPBuilder.com has posted part six of their "Using XML" series today with a focus on validation techniques using both normal PHP abilities and the XSL functionality in PHP5 with the Schematron language.
This series has so far focused on XML technologies and how they can be utilised using PHP 5. A subject we have not touched upon yet, is XML validation. This article will explore the application independent XML validation standards of DTD's, the XML Schema Language and the XSLT-based Schematron language.
They point back to part one of the series for the XML library they'll use and waste no time getting right into the code. They demonstrate a simple validation first before moving on to the use of DTDs to ensure the correct content. Next up is more work with the XML schemas continuing on to the Schematron functionality (their use and validation).
voice your opinion now!
xml validation xsl schematron dtd dom tutorial part6 xml validation xsl schematron dtd dom tutorial part6
PHP.net: PHP 5.1.4 Released
by Chris Cornutt May 05, 2006 @ 06:29:09
The PHP group has officially released the latest update in the PHP 5.1.x series today - PHP 5.1.4, a bugfix release to take care of the $_POST array handling problem from 5.1.3.
A critical bug with $_POST array handling as well as the FastCGI sapi have been discovered in PHP 5.1.3. A new PHP release 5.1.4 is now available to address these issues. All PHP users are encouraged to upgrade to this release as soon as possible.
Further details about this release can be found in the release announcement and the full list of changes is available in the PHP 5 ChangeLog.
Due to the wide-spread nature of this bug, updating to this latest version would be a very good idea. There are a few other bugs that were fixed in the release as well including issues with the FastCGI sapi, a fix to a possible crash in hightlight_string, cloning of DOM Documents and Noded, and several fixes to the PDO ODBC driver.
You can download this latest update here.
voice your opinion now!
5.1.4 release official bugfix post fastcgi dom pdo 5.1.4 release official bugfix post fastcgi dom pdo
David Sklar's Blog: Speed - DOM traversal vs. XPath in PHP 5
by Chris Cornutt February 23, 2006 @ 06:43:03
On his blog today, David Sklar has this new post that compares the speed of two methods of grabbing info from an XML document in PHP5 - DOM traversal versus XPath.
Needing to pick out some bits from a smallish (40 lines) XML document studded with namespaces, I first turned to DomXPath. Worked great, code's concise, XPath expression is simple. But I had the nagging thought that using DOM traversal functions should be faster.
The results from his test? The DOM traversal is about four times faster than using XPath to achieve the same thing.
That 4x speed multiple translates into about a half second to execute for the XPath code and about 0.13 seconds to execute for the DOM code when each is run 10,000 times. Since a typical use of this code will involve it running maybe 10 or 20 times during a request, I'm happy to sacrifice a few microseconds of processor time in exchange for simpler code.
voice your opinion now!
speed xml parse dom traversal xpath php5 speed xml parse dom traversal xpath php5
PHPBuilder.com: Using XML - A PHP Developer's Primer
by Chris Cornutt February 07, 2006 @ 07:10:24
PHPBuilder.com has posted a new tutorial targeted at those developers out there wokring to get into the XML functionality that PHP offers. They look to help (in a very general way) introduce you to the fundamentals on what XML is and how to manipulate it with what PHP has to offer.
This series of articles will focus on XML, its applications in modern day web development and how PHP fits into this niche. In this article, we will focus specifically on the tools provided to us by PHP which enable us to manipulate XML data sources.
They cover what XML is, what it looks like, and talk about some of the simple applications that it can bse used for (in PHP or otherwise). They focus on the newer XML features of PHP - DOM, SimpleXML, and XPath. They show some of the PHP code to parse out bits from their sample XML and show how easy it is to port the DOM code over to another language (this time, Javascript). They finish things off with code examples for grabbing the same data in the other technologies - SimpleXML and XPath...
voice your opinion now!
xml developer primer dom simplexml xpath xml developer primer dom simplexml xpath
IBM developerWorks: Reading and writing the XML DOM with PHP
by Chris Cornutt December 08, 2005 @ 08:18:57
On the IBM developerWorks page today, there's this new tutorial dealing with reading and writing XML with the DOM functionality in PHP.
Myriad techniques are available for reading and writing XML in PHP. This article presents three methods for reading XML: using the DOM library, using the SAX parser, and using regular expressions. Writing XML using DOM and PHP text templating will also be covered.
They look at what XML is, how to read it into PHP (with examples of DOM, SAX parsers, and regular expression methods), and writing out XML. The DOM functionality that they use for the examples is the newer, PHP5-compatable methods...
voice your opinion now!
xml reading writing dom php5 xml reading writing dom php5
|
Community Events
Don't see your event here? Let us know!
|