How to access an XML document in PHP

There two common ways to access an xml document using PHP. One is the usual Document Object Model and the other is by using the SAX parser that comes with all the installation of PHP.

_______________________________________________


_______________________________________________


Using the Document Object Model is the common way used by many developers to access the xml documents. You might have worked with the DOM in other languages too. The steps are the same.

The first step is to create a new document object using the command, new DOMDocument(); and the next step is to load the xml file into that object. For this you can use the command, load('xmlfilename.xml').

After this is done you can navigate through the xml document using the functions like getElementsByTagName. By using this function you can store all the nodes in a particular array and then use the array's item(n)->nodeValue to get the values of the nodes, where n is the node number.

You can also access the xml document using the SAX parser that comes with the installation of PHP. It is lightweight and that is the advantage of using it. Moreover it can also be used for large xml files.

JustSystems' xfy Achieves Ready for IBM Retail Integration Framework Status (Business Wire via Yahoo! Finance)
NEW YORK----JustSystems, the largest independent software vendor in Japan and a worldwide leader in XML and information management technologies, today announced that it has successfully completed testing of xfy , its document-based composite application for the IBM Retail Integration Framework. xfy serves as a management interface, providing retailers optimal management and decision support ...

A Format for Digital Preservation of Images (D-Lib Magazine)
Digital preservation requires a strategy for the storage of large quantities of data, which increases dramatically when dealing with high resolution images. Typically, decision-makers must choose whether to keep terabytes of images in their original TIFF format or compress them.

XyEnterprise Unveils New Version of Its Award-Winning Content Management Software (PRWeb)
Contenta 4.0 adds support for SQL Server and Red Hat Enterprise Linux. (PRWeb Jul 15, 2008) Read the full story at http://www.prweb.com/releases/2008/07/prweb1107694.htm

XyEnterprise Unveils New Version of Its Award-Winning Content Management Software (PRWeb via Yahoo! News)
Contenta 4.0 adds support for SQL Server and Red Hat Enterprise Linux.



FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________

Recommended XML Books

cover
cover
cover
cover
cover
cover






 

 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!


New XML Books Titles - Best Seller's @ Amazon.com

Visit XML Training Material Guide Homepage

Technology helps engage students - how do classroom instruction and social dynamics change when the classroom is completely dependant on modern technology?

Dallas Web Design- local Dallas web design firm offers site design and backend system development