Click to See Complete Forum and Search --> : Xml into html (php page)


nimrod_king
04-16-2009, 06:35 AM
I have an xml file called myxml.xml

how do i get it to display in my html that has extention of .php, im guessing its in a table format?

myxml file shown below...

<?xml version="1.0" encoding="ISO-8859-1"?>
<VoucherManager>
<voucher>
<MerchantName>Klaus Kobec</MerchantName>
<AffiliateURL>http://www.paidonresults.net/c/00000/1/244/0</AffiliateURL>
<VoucherCode>EXPPREV</VoucherCode>
<VoucherDescription>£46 off the entire Klaus Kobec Ice Range!</VoucherDescription>
<StartDate>15/04/2009</StartDate>
<ExpiryDate></ExpiryDate>
</voucher>
<voucher>
<MerchantName>Caraselle</MerchantName>
<AffiliateURL>http://www.paidonresults.net/c/00000/1/368/0</AffiliateURL>
<VoucherCode>FIVER</VoucherCode>
<VoucherDescription>Spend £29.99 Or More And Receive £5 Off</VoucherDescription>
<StartDate>09/04/2009</StartDate>
<ExpiryDate>31/05/2009</ExpiryDate>
</voucher>
<voucher>
<MerchantName>Stauer</MerchantName>
<AffiliateURL>http://www.paidonresults.net/c/00000/1/339/0</AffiliateURL>
<VoucherCode>AWFREE</VoucherCode>
<VoucherDescription>Free postage and packing</VoucherDescription>
<StartDate>07/04/2009</StartDate>
<ExpiryDate>30/04/2009</ExpiryDate>
</voucher>
</VoucherManager>

tracknut
04-16-2009, 09:13 AM
I've been using the SimpleXML (http://us2.php.net/simplexml) library in PHP5 for this kind of thing - very easy.

Dave

gordongreg
04-17-2009, 04:29 AM
:p
:confused:

gordongreg
04-17-2009, 04:32 AM
hi
i have one doubt on xml
how to see xml file into browser plz can be help me

Charles
04-17-2009, 05:52 AM
Most browsers these days display XML just fine as it is. But if you want to control the look then see http://www.w3schools.com/xsl/ .