PHP not creating well-formed XML
Posted: Tue Jan 17, 2006 9:23 pm
Hi,
I'm using the following code to generate an XML file, but I keep getting the following warning. I'm not sure what the problem is, perhaps it's getting confused because of the = sign, but it gets past the one after "module" just fine. I tried using ≡ but that didn't work either.
Thanks,
Here's the full output.
And, this probably doesn't matter, but here's the PHP that generates it.
I'm using the following code to generate an XML file, but I keep getting the following warning. I'm not sure what the problem is, perhaps it's getting confused because of the = sign, but it gets past the one after "module" just fine. I tried using ≡ but that didn't work either.
Thanks,
Code: Select all
XML Parsing Error: not well-formed
Location: http://www.realitygrp.com/xml.php?mode=links
Line Number 3, Column 64:
<link name=">Current Events" ref="home.php?module=Category&cat=37"/>
-----------------------------------------------------------------^Code: Select all
<links name="FEATURED CHANNELS">
<link name=">Link 1" ref="home.php?module=Category&cat=37"/>
<link name=">Link 2" ref="home.php?module=Category&cat=38"/>
<link name=">Link 3" ref="home.php?module=Category&cat=39"/>
<link name=">Link 4" ref="home.php?module=Category&cat=40"/>
<link name=">Link 5" ref="home.php?module=Category&cat=41"/>
<link name=">Link 6" ref="home.php?module=Category&cat=42"/>
</links>Code: Select all
echo "<links name=\"FEATURED CHANNELS\">\n";
// LOOP
$CATS = new DB;
$CATS->query("SELECT id FROM category WHERE parentid = 0 ORDER BY id");
// IF WE'RE ON A SUB NAV, GET THE TOP LEVEL CATEGORY
$TOPCAT = $THISCATEGORY->parent_path[1];
foreach ($CATS->all_rows AS $category) {
$NAVIGATION = new Category;
$NAVIGATION->GetById($category['id']);
echo "\t<link name=\">{$NAVIGATION->title}\" ref=\"home.php?module=Category&cat={$NAVIGATION->id}\"/>\n";
}
echo "</links>\n";