La negoziazione del contenuto può essere implementata tramite alcuni linguaggi lato server, come PHP o ASP. Di seguito alcuni esempi.
$accept = $_SERVER["HTTP_ACCEPT"];
$ua = $_SERVER["HTTP_USER_AGENT"];
if (isset($accept) && isset($ua)) {
if (stristr($accept, "application/xhtml+xml") || stristr($ua, "W3C_Validator")) {
header("Content-Type: application/xhtml+xml");
}
}
Dim strAccept, strUA
strAccept = Request.ServerVariables("HTTP_ACCEPT").Item
strUA = Request.ServerVariables("HTTP_USER_AGENT").Item
If InStr(1, strAccept, "application/xhtml+xml") > 0 Or InStr(1, strUA, "W3C_Validator") > 0 Then
Response.ContentType = "application/xhtml+xml"
End If
Alcuni riferimenti: