How to use PHP DOM functions to create XML

Do you need to create XML using PHP? Then you can use the PHP DOM functions to create an XML file. If you have worked with PHP 4 earlier then there is a slight change in the syntax of PHP 5. It is easy to work with this syntax if you have already worked with the browser's DOM functions.

_______________________________________________


_______________________________________________


The new DomDocument() function is used to create a new DOM Document object. After creating the new document object, you can add elements to it using the document object's createElement() method.

Using this method you can create the different elements that are needed for the document. Suppose you want to add a text content to the particular node you can use the createTextNode() method to create the text node and then use appendChild() method to append that text node to any element of your choice.

Then append that element to the root node of the XML document using the same appendchild() method. Now you can save the XML to another file also or print it out in the browser.

eValid Supports Regular Expressions Analysis of Web Pages (PRWeb via Yahoo! News)
Functional testing of web applications now has a new degree of generality with the introduction of Regular Expression processing in the eValid suite.

posted by Will Senn on Wed 30th Nov 2005 19:03 UTC (OS News)
This latest installment in the Core series from Prentice Hall PTR is a welcome arrival to the PHP/MySQL space. It is jam packed with useful information. At a little over 850 pages, this volume contains information on nearly every topic of interest in both the PHP and MySQL subject areas.

Once Nearly Invisible To Search Engines, Flash Files Can Now Be Found And Indexed (TechCrunch)
For most people on the Web, if Google or Yahoo cannot find something, it doesn't exist. That has been one of the biggest drawbacks to creating a Website or application that displays itself as a Flash (SWF) file. Search engines could see the file, but they could not see what was in it. [...]



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