Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BASIC XML PROBLEM

Status
Not open for further replies.

tugalsan

Programmer
Joined
Sep 24, 2010
Messages
2
Location
TR
I want to add my map to google as below. but sth is wrong and it gives error as below. pls help :(

FILE:

ERROR on internet explorer as well as on google bot:
XML Parsing Error: not well-formed
Location: Line Number 4, Column 63: <loc>--------------------------------------------------------------^

FILE CONTENT:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns=" <url>
<loc> <lastmod>2010-09-24</lastmod>
<changefreq>weekly</changefreq>
</url>
.
.
.
<url>
<loc> <lastmod>2010-09-24</lastmod>
<changefreq>weekly</changefreq>
</url>
</urlset>
 
[0] Due to the artifact of the site rendering of href-like string, the loc tag content is not actually properly escape in the sample xml. The ampersand is actually not escaped as &amp; in the map.xml. This is erroneous and consequently the xml is not well-formed.

[1] The way to amend the xml document is to make every loc tag containing CDATA section, like this as an illustration.
[tt]
<loc>[red]<![CDATA[[/red][ignore][/ignore][red]]]>[/red]</loc>
[/tt]
 
I did learn that CDATA thing in my university years; but never tought of using it in bussinesslife.

Thanks tsuji. You are a life saver.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top