Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.6k views
in Q2A Core by

Did anybody come up with a solution to "Invalid Tag Value" in sitemap?

Invalid tag value in line 181 (http://www.checkthishouse.com/qa/sitemap.xml)

This XML tag has an invalid value. Please fix it and resubmit.

Parent tag: url
Tag: priority
Value: 1.0001587043499
Problem detected on: Nov 8, 2011
 
Any help would be appreciated,
Thank you
related to an answer for: xml error in sitemap

1 Answer

+2 votes
by
selected by
 
Best answer
hi,

this is my quick and dirty hack. edit  qa-plugin/xml-sitemap/qa-xml-sitemap.php

add:

$priority = number_format($priority,0); //fixed priority 123.00 to 123

or

$priority = number_format($priority,1); //fixed priority 123.00 to 123.0

so the new function will look like this

function sitemap_output($request, $priority)
                {
                $priority = number_format($priority,0); //fixed priority 123.456
                        echo "\t<url>\n".
                                "\t\t<loc>".qa_path_html($request, null, qa_opt('site_url'))."</loc>\n".
                                "\t\t<priority>".$priority."</priority>\n".
                                "\t</url>\n";
                }
 

not sure if parsefloat/cast function can fixed this but I just want quick fix. Thanks :)
by
That did it!
Google says it's OK :-).
Thanks affandy!
by
Thanks. First one did it.
by
Same with me buddy.. Lemme try your fix..

http://goanswered.com/index.php/sitemap.xml
...