Project

General

Profile

Actions

Bug #63899

closed

Rendering XML output with the PAGE object goes wrong in TYPO3 6.2.x

Added by Arek van Schaijk almost 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2014-12-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

It looks like TYPO3 doesn't render the XML output well in TYPO3 6.2.x by using the TypoScript PAGE object.

I'm using the following configuration:

xmlsitemap = PAGE
xmlsitemap {
    typeNum = 1234
    10 = USER_INT
    10 {
        userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
        pluginName = Pi1
        extensionName = MyExt
        vendorName = TYPO3
        controller = XmlSitemap
        action = render
        switchableControllerActions {
            XmlSitemap {
                1 = render
            }
        }
    }
    config {
        disableAllHeaderCode = 1
        additionalHeaders = Content-type:text/xml
        xhtml_cleaning = 0
        admPanel = 0
        debug = 0
    }
}

The controller returns the following content (this works fine in 4.5, 4.6 and 4.7):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.domain.com/</loc>
    <lastmod>2014-11-20T11:37:00+01:00</lastmod>
    <changefreq>monthly</changefreq>
  </url>
  [..]
</urlset>

But in 6.2.x the output looks like:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<?xml version="1.0" encoding="UTF-8"?><html><body><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>http://www.domain.com/</loc><lastmod>2014-12-12T14:12:35+01:00</lastmod><changefreq>monthly</changefreq></url>[..]</urlset></body></html>

- Everything is rendered on a single line (error on line 2 at column 6: XML declaration allowed only at the start of the document).
- HTML and BODY tag are added.

I've tried also this configuration but it didn't work:

xmlsitemap = PAGE
xmlsitemap {
    typeNum = 1234
    10 = USER_INT
    10 {
         [..]
    }
    config {
        [..]
        xmlprologue = <?xml version="1.0" encoding="[config.renderCharset]">
        config.doctype (
            <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
        )
    }
}

So it looks like TYPO3 6.2.x doesn't render the XML output well.

Actions

Also available in: Atom PDF