Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

xmlns dissapear from HTML header


Go to End


2 Posts   1899 Views

Avatar
xmedeko

Community Member, 94 Posts

21 May 2007 at 1:23pm

Hi,
I have in the beginning of my template:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >

but when I do "view source" in my firefox, then i see only

<html xml:lang="en" >

I have to put

<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >

to the template to see it right in the browser.

Avatar
Sean

Forum Moderator, 922 Posts

21 May 2007 at 1:29pm

This could be to do with the fact ContentNegotiator is rewriting the XHTML doctype you're using to HTML 4.01. Either do the following:

To disable content negotiation:

add ContentNegotiator::disable(); to _config.php

Or, to amend the problem without disabling the content negotiator, add
<?xml version="1.0" encoding="UTF-8"?> before the doctype.

Cheers,
Sean