I did some debugging and its seems the problem is occuring in "appendTV" function in ditto class.
In the following code
$query = "SELECT name,type,display,display_params,default_text";
$query .= " FROM $tb2";
$query .= " WHERE name='".$tvname."' LIMIT 1";
$rs = $modx->db->query($query);
$row = @$modx->fetchRow($rs);
$defaultOutput = getTVDisplayFormat($row['name'], $row['default_text'], $row['display'], $row['display_params'], $row['type'],$row['contentid']);
In the case of my problem, the function "getTVDisplayFormat" is called with "default_text" being @INHERIT and "contentid" being the id of the sitemap page.
"name" is the name of the variable to get (sitemap_priority or sitemap_changefreq).
The page sitemap.xml has a blank template and does not have those TVs defined (doesn’t need to).
When sitemap.xml is child of root (0) it seems that because the TV are neither defined in sitemap.xml nor in the root it doesn’t work. ($defaultOutput is empty)
When sitemap.xml is child of a folder (en or sr), the parent have those TVs defined and it works. ($defaultOutput is set to the value in the parent)
Now the problem is that it should not matter what TVs are defined on the page where the call to ditto is made but only on the pages that are included in the ditto result.
In order words, where is the page with the ditto call located should not affect the result. Especially since that page is excluded from the result.
It hard for me to debug further as I do not know the mecanic to go from @INHERIT to the value and how is that done for each page of the result.
lionel