SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict dr_dumb99's Avatar
    Join Date
    Sep 2004
    Location
    Pakistan
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question XML Data Is Not Properly Showing

    Hi!
    I have generated XML file through following code

    PHP Code:
    header("Content-type: text/xml"); 

    $query = "SELECT * FROM xml ORDER BY id"; 
    $resultID = mysql_query($query, $linkID) or die("Data not found."); 

    $xml_output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
    $xml_output .= "<listings>\n"

    for(
    $x $x mysql_num_rows($resultID) ; $x++){ 
        
    $row mysql_fetch_assoc($resultID); 
        
    $xml_output .= "\t<listing>\n"
        
    $xml_output .= "\t\t<category>".$row['category']."</category>\n";
        
    $xml_output .= "\t\t<id>".$row['id']."</id>\n";
        
    $xml_output .= "\t\t<title>".$row['title']."</title>\n";
        
    $xml_output .= "\t\t<url>auctiondetails.php?id=".$row['id']."</url>\n";
        
    $xml_output .= "\t\t<city>".$row['city']."</city>\n";
        
    $xml_output .= "\t\t<state>".$row['state']."</state>\n";
        
    $xml_output .= "\t\t<zip_code>".$row['zip']."</zip_code>\n";
        
    $xml_output .= "\t\t<condition>New</condition>\n";
        
    $xml_output .= "\t\t<create_time>".$row['create_time']."</create_time>\n";
        
    //$xml_output .= "\t\t<description>".str_replace("\"","&quot;",str_replace(">","&gt;",str_replace("<","<",str_replace("&", "&", $row['description']))))."</description>\n";
        
    $xml_output .= "\t\t<description>".html_entity_decode($row['description'])."</description>\n";
        
    $xml_output .= "\t\t<expire_time>".$row['expire_time']."</expire_time>\n";
        
    $xml_output .= "\t\t<image_url>".$row['image_url']."</image_url>\n";
        
    $xml_output .= "\t\t<price>".$row['price']."</price>\n";
        
    $xml_output .= "\t</listing>\n"


    $xml_output .= "</listings>"

    echo 
    $xml_output;

    And following is the value of $row['description'], which in my opinion, giving error.

    &lt;center&gt;&lt;h4&gt;&lt;br&gt;&lt;br&gt;&lt;/h4&gt;&lt;/center&gt;&lt;!-- ##### TEMPLATE CODE BEGINS HERE #### --&gt; &lt;br /&gt;&lt;table width=740 border=2 bordercolor=#000000 cellpadding=40 cellspacing=0 bgcolor=white align=center background=http://i20.photobucket.com/albums/b224/Velvetstouch/back.jpg&gt; &lt;tr&gt;&lt;td&gt; &lt;table width=660 border=2 bordercolor=#000000 cellpadding=20 cellspacing=0 background="&lt;http://www.deadzoom.com/member/velvetstouch/Bubbles.gif&gt;"&gt; &lt;tr&gt;&lt;td style="font-family: comic sans ms; font-size: 18px"&gt; &lt;h2 style="font-family: comic sans ms; font-size: 24px" align=center&gt;&lt;center&gt;&lt;img src=http://i20.photobucket.com/albums/b224/Velvetstouch/springposieshead.gif&gt;&lt;CENTER&gt;&lt;/CENTER&gt;&lt;/CENTER&gt; &lt;TR&gt; &lt;TD align=middle bgColor=WHITE&gt;&lt;FONT face="Comic Sans Ms" color=hotpink size=6&gt; &lt;B&gt;HEIDI ~ A LITTLE GOLDEN BOOK ~ 1982!&lt;B&gt;&lt;/U&gt;&lt;/B&gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt; &lt;TR&gt; &lt;/h2&gt;&lt;div align=justify&gt;&lt;p style="font-family: comic sans ms; font-size: 18px"&gt; &lt;h3&gt; &lt;tr bgcolor="#ffffff"&gt; &lt;td colspan="3"&gt; &lt;table width="550" border="0" cellpadding="10" cellspacing="1" width="100%" align="center"&gt; &lt;tr bgcolor="#ffffff"&gt; &lt;td colspan="3"&gt; &lt;table width="550" border="0" cellspacing="0" cellpadding="4" bgcolor="#000000" align="center"&gt; &lt;tr&gt; &lt;td bgcolor="#FFFFFF" align="center"&gt;&lt;span id="ttl"&gt;&lt;font color="#cc0000"&gt;&lt;b&gt;&lt;/b&gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;table border="0" cellspacing="2" cellpadding="4" width="100%"&gt; &lt;tr&gt;&lt;td class="bordergall" bgcolor="#eeeeee" width="30%" align="center"&gt;&lt;b&gt;BOOK&lt;/b&gt;&lt;/td&gt;&lt;td colspan="4" class="bordergbt"&gt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="bordergry"&gt;&lt;p&gt;&lt;span id="small"&gt; &lt;U&gt;&lt;/u&gt;&lt;/span&gt;&lt;br&gt;&lt;b&gt;A LITTLE GOLDEN BOOK!&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td class="bordergry"&gt;&lt;p&gt;&lt;span id="small"&gt;&lt;u&gt; &lt;class="bordergry"&gt;&lt;p&gt; &lt;/p&gt;&lt;/td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt; &lt;p&gt;&lt;img src=http://i20.photobucket.com/albums/b224/Velvetstouch/lgbheidi.jpg&gt;&lt;/center&gt; &lt;/center&gt; &lt;CENTER&gt;&lt;BR&gt;&lt;B&gt;&lt;/A&gt;&lt;/B&gt;&lt;/CENTER&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt; &lt;TR&gt; &lt;TD bgColor=white&gt;&lt;FONT face="Helvetica,Comic Sans Ms" color=black size=6&gt;&lt;B&gt;&lt;CENTER&gt;HEIDI ~ A LITTLE GOLDEN BOOK ~ 1982!&lt;FONT&gt; &lt;CENTER&gt;&lt;/CENTER&gt;&lt;/TD&gt;&lt;/TR&gt; &lt;/style&gt;&lt;body background=http://i20.photobucket.com/albums/b224/Velvetstouch/tanbk1.jpg bgproperties=fixed&gt; &lt;TR&gt; &lt;TD&gt;&lt;FONT face="CARBON BLACK" color=black size=4&gt;&lt;U&gt;&lt;B&gt; &lt;B&gt;&lt;/U&gt;&lt;/B&gt;&lt;BR&gt;&lt;BR&gt; &lt;center&gt;HEIDI ~ A LITTLE GOLDEN BOOK ~ 1982! Adapted from the original story by Johanna Spyri and pictures by Corinne Malvern. Published by Western Publishing Inc., copyright 1982. The number on the front of this book is 207-52.&lt;p&gt;&lt;font size=4&gt;&lt;b&gt;Heidi is a wonderful little book that has awesome illustrations as you read through this book with your child. This book would make a nice addition to your collection or to your child's library!&lt;p&gt;&lt;font size=4&gt;&lt;b&gt; This hardcover book measures 6 1/2" X 7 3/4". It shows very little shelf wear as pictured. The binding is nice and intact along with all for corners. This book has been gently read but well taken care of! There is no writing, marks or dog-eared pages or tears to any of the pages. &lt;p&gt;&lt;font size=4&gt;&lt;b&gt; &lt;br&gt;Please give the gift of reading to a child. If you have any questions or need more pictures, please email me and I will be happy to assist you. &lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/B&gt;&lt;/P&gt;&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt; &lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;BR&gt;&lt;B&gt; &lt;br&gt;&lt;!-- PayPal Logo --&gt; &lt;table border="0" cellpadding="10" cellspacing="0" align="center"&gt;&lt;tr&gt;&lt;td align="center"&gt; &lt;tr&gt;&lt;td align="center"&gt;&lt;a href="https://www.paypal.com/us/auction/pal=6MRLKCWFNP6TE" target="_blank"&gt;&lt;img src="http://www.paypal.com/en_US/i/logo/logo3pv.gif" border="0" alt="PayPal-eBays service to make fast, easy, and secure payments for your eBay purchases!" title="PayPal-eBays service to make fast, easy, and secure payments for your eBay purchases!"&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td align="center"&gt;&lt;table cellpadding=0 cellspacing=0 border=0&gt; &lt;tr&gt; &lt;td valign=top align=left&gt;&lt;img src="https://www.paypal.com/en_US/i/logo/logo_ccVisa.gif" border=0 alt=" Visa"&gt;&lt;wbr&gt;&lt;img src="https://www.paypal.com/en_US/i/logo/logo_ccMC.gif" border=0 alt=" Mastercard"&gt;&lt;wbr&gt;&lt;img src="https://www.paypal.com/en_US/i/logo/logo_ccDiscover.gif" border=0 alt=" Discover"&gt;&lt;wbr&gt;&lt;img src="https://www.paypal.com/en_US/i/logo/logo_ccAmex.gif" border=0 alt=" American Express"&gt;&lt;wbr&gt;&lt;img src="https://www.paypal.com/en_US/i/logo/logo_ccEcheck.gif" border=0 alt=" eCheck"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;!-- End PayPal Logo --&gt; <br> &lt;/CENTER&gt; &lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;BR&gt;&lt;B&gt; &lt;CENTER&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;&lt;p&gt;&lt;table border=10 width=100% bordercolor=BLACK cellpadding=25 bgcolor=white&gt;&lt;tr&gt;&lt;td&gt;&lt;font face=arial color=hotpink size=5&gt;&lt;b&gt;PAYMENT TERMS&lt;/b&gt;&lt;p&gt;&lt;font face=arial size=4 color=black&gt; &lt;center&gt; &lt;Center&gt;&lt;img src=http://i20.photobucket.com/albums/b224/Velvetstouch/springhatblnk4.gif&gt; &lt;center&gt;United States Buyers may pay with Cashier Checks, Money Orders, Personal Checks or PAYPAL. I may hold personal checks for 10-14 days for clearance. All payments must be received within 7-10 days of close of the auction or the item will be relisted.&lt;br&gt;&lt;font color=black&gt;&lt;FONT color=black SIZE=4&gt;International Buyers must pay via PAYPAL in the amount using U.S. Funds. No over payments will be accepted.&lt;/center&gt;&lt;p&gt;&lt;hr&gt;&lt;p&gt;&lt;font face=arial color=hotpink size=5&gt;&lt;b&gt;SHIPPING CHARGES&lt;/b&gt;&lt;p&gt;&lt;font face=arial size=4 color=black&gt; &lt;center&gt;United States Buyers are to add $2.50 for shipping. I would be happy to combine shipping on any two or more of my items to help save on cost. Just let me know. Insurance is available for an additional cost of $1.30 if desired. If insurance is not purchased, I cannot be responsible for the item once it has been shipped. &lt;P&gt;&lt;font size=4&gt;International Buyers must email me first for a quote based on your location.&lt;/center&gt;&lt;p&gt;&lt;hr&gt;&lt;p&gt;&lt;font face=arial color=hotpink size=5&gt;&lt;b&gt;RETURN POLICY&lt;/b&gt;&lt;p&gt;&lt;font face=arial size=4 color=black&gt; &lt;center&gt;I will except returns with a reasonable explanation. All returns must be returned within 5-7 days in the same manner and condition is which it was received. All shipping and handling is the buyers responsibility and will not be refunded. &lt;/center&gt;&lt;p&gt;&lt;hr&gt;&lt;p&gt;&lt;font face=arial color=hotpink size=5&gt;&lt;b&gt;FEEDBACK POLICY&lt;/b&gt;&lt;p&gt;&lt;font size=4 color=black&gt; &lt;center&gt;I am an experienced seller and am proud of my 100% positive feedback from two other sites. I strive for customer satisfaction and will always leave my buyers appropriate feedback. I contact my buyers within 24 hours of close of aution, if you do not hear from me via email, please attempt to email me due to the fact that many people have spam blockers on their email accounts. Please see my About Me page and bid with confidence. Thanks for stopping by and have a great day! &lt;CENTER&gt;&lt;P&gt;&lt;img src=http://i20.photobucket.com/albums/b224/Velvetstouch/cid_00a801c5510be8950ea06901a8c0-1.gif&gt; <br>&lt;P&gt;&lt;p&gt;&lt;CENTER&gt; &lt;img src="http://i14.photobucket.com/albums/a306/tugboatofjewels/autismawareness2.gif"&gt; <br> &lt;p&gt;&lt;CENTER/&gt; &lt;br&gt;&lt;br&gt; &lt;/td&gt;&lt;/tr&gt;&lt;br&gt;&lt;h3&gt; &lt;/p&gt;&lt;/div&gt; &lt;h3 style="font-family: comic sans ms; font-size: 20px; font-weignt: bold" align=left&gt;&lt;/h3&gt;&lt;div align=justify&gt;&lt;p style="font-family: comic sans ms; font-size: 18px"&gt; &lt;/p&gt;&lt;/div&gt; &lt;p style="font-family: comic sans ms; font-size: 18px" align=center&gt; &lt;p style="text-align: center; font-family: arial; font-size: 14px"&gt;&lt;/p&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;!-- ##### TEMPLATE CODE ENDS HERE ##### --&gt;<br><br><br>





    /********************************/
    But when I run the page, It gives me error [below the web page] . For clarification/details kinldy visit following link :

    http://vibersol.com/sitesdemo/odle/rss.php


    Can anyone help me in this regards

    Thanks in Advance

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The XML Validator returns: Element type "br" must be terminated by the matching end-tag "</br>".

    My guess: use <br/>
    FOR SALE: 1 set of morals, never used, will sell cheap

  3. #3
    SitePoint Addict dr_dumb99's Avatar
    Join Date
    Sep 2004
    Location
    Pakistan
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your guidance. Can you tell me that is there any php script/code which automatically removes this sort of bugs from string and then display properly.

    Thanks in advance

  4. #4
    Always learning kigoobe's Avatar
    Join Date
    May 2004
    Location
    Paris
    Posts
    1,565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can do a string replace to change all existing <br> to <br />

    PHP Code:
    $themessage str_replace('<br>''<br />'$themessage);
    $themessage str_replace('&lt;br&gt;''&lt;br /&gt;'$themessage); 

  5. #5
    SitePoint Addict dr_dumb99's Avatar
    Join Date
    Sep 2004
    Location
    Pakistan
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have applied your helpful tips. Now it is showing another error. And it is totally new error.

    For error, kindly visit following url:

    http://vibersol.com/sitesdemo/odle/rss.php

    Thanks in advance

  6. #6
    Always learning kigoobe's Avatar
    Join Date
    May 2004
    Location
    Paris
    Posts
    1,565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it seems your whole file is following the old html way. Make them xhtml way, will work better, like <br> should be <br />, <table width=740 should be <table width="740", etc.

    For more info and other issues, please consult this


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •