|
| |||||||||
| Tags: core dom, dom, html dom, php, xml, xml file |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to use XML DOM in PHP?
Hi friends, I am new to DOM term. I am not having much knowledge about the XML DOM.!! So thought that you guys would help me a bit. Please explain me how to use XML DOM in PHP? Any other information related to the topic would be grateful. Please help me as soon as possible. ![]() |
|
#2
| ||||
| ||||
| Re: How to use XML DOM in PHP?
Before moving to the XML DOM, I recommend you to know about the DOM. The DOM provides a standard set of objects for HTML and XML documents, and a standard interface for accessing and manipulating them. DOM is separated into three different parts which are described as follows :
__________________ 3.2 (northwood) 2gig ramATI AIW X800xt 256mb Gigabyte GA-8knxp 875p Chipset Optiwrite 8X DVD Burner Win XP PRO Sp2 (Works Perfectly) 2 SATA Raptor 74gig Raid 0 2 7200 IDE 320gig HD |
|
#3
| ||||
| ||||
| Re: How to use XML DOM in PHP?
For using the XML DOM you need to write an XML file, so I have given you the sample of the coding which can be useful for you : Code: <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Jack</to> <from>Panni</from> <heading>Reminder</heading> <body>There is Party Tomorrow!</body> </note>
__________________ I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame. |
|
#4
| ||||
| ||||
| Re: How to use XML DOM in PHP?
You can load and do the output a XML file using the following code : Code: <?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("demo.xml");
print $xmlDoc->saveXML();
?> |
|
#5
| ||||
| ||||
| Re: How to use XML DOM in PHP?
You will have to loop through an XML, for doing that you can use the following code : PHP Code:
__________________ Grand Theft Auto 4 PC Video Game |