Darkside  

Voltar   Darkside > Darkside > Comunidade

Responder
 
Thread Tools
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
Default [HELP] Validação de XHTML 1.1

06-11-07, 14:14 #1
Olá DarkNerds programadores. Estou enfrentando uma dificuldade com a validação de um documento XHTML 1.1.

Na verdade, ele valida (sem erros), mas dá um alerta, que é o seguinte:

Quote:
Postado por W3C Validator
This Page Is Valid XHTML 1.1!
Result: Passed validation, 1 warning(s)

Conflict between Mime Type and Document Type

The document is being served with the text/html Mime Type which is not a registered media type for the XHTML 1.1 Document Type. The recommended media type for this document is: application/xhtml+xml

Using a wrong media type for a certain document type may confuse the validator and other user agents with respect to the nature of the document, and you may get some erroneous validation errors. How to fix this problem? One of the following techniques should help:

* If you are serving a static file on a Web server, changing its extension should help. Use e.g .xhtml for XHTML or .mathml for MathML.
* You may need to reconfigure your Web server. This Setting up MIME Types tutorial has instructions for Apache, Tomcat and IIS.
* If the document is generated dynamically, the scripting language should allow you to set up the mime type: this article on MIME Types and Content Negotiation has examples in PHP, Perl, and ASP.
Eu não faço idéia de como resolver isso. Vocês sabem?

[]'s
NiGhTWolF





night is offline   Reply With Quote
Bombastic
The Alpha Male
 

06-11-07, 14:16 #2
muda o header do application type para 'application/xhtml+xml' e nao text/html

Bombastic is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
06-11-07, 14:21 #3
Como, Bomba? Assim?

De:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>@</title>
<link href="css/padrao.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/noticias.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if lt IE 7]>
<link href="css/iehack.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
</head>

Para:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml" />
<title>@</title>
<link href="css/padrao.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/noticias.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if lt IE 7]>
<link href="css/iehack.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
</head>

?

night is offline   Reply With Quote
Bombastic
The Alpha Male
 

06-11-07, 14:22 #4
essa pode ser uma das solucoes

Bombastic is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
06-11-07, 14:25 #5
Essa não resolveu.
=(

Tem que configurar alguma coisa no servidor? Se tiver, fodeu, porque não tenho acesso.

night is offline   Reply With Quote
maxcool
Banned
 

PSN ID: atcasanova
06-11-07, 14:27 #6
ninguem tem?
manda alguem botar um addtype la q deve resolver, se for apache :}

maxcool is offline   Reply With Quote
maxcool
Banned
 

PSN ID: atcasanova
06-11-07, 14:28 #7
AddType application/xhtml+xml;charset=iso-8859-1;qs=0.999 .xhtml


tenta isso la :}

maxcool is offline   Reply With Quote
punisher
spkr
 

06-11-07, 14:29 #8
não é nada no servidor, é no arquivo mesmo, e isso deveria ter resolvido

punisher is offline   Reply With Quote
maxcool
Banned
 

PSN ID: atcasanova
06-11-07, 14:30 #9
ou charset utf-8

maxcool is offline   Reply With Quote
didz
#NPNÃO
 

Gamertag: Stefan Prestes PSN ID: stefanprestes XFIRE ID: exxhail Steam ID: didz
06-11-07, 14:32 #10
Incompetente..

didz is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
06-11-07, 14:32 #11
didz, recolha-se à sua insignificância.

night is offline   Reply With Quote
Ted
Trooper
 

Gamertag: MassahudDS PSN ID: massahud Steam ID: massahud
06-11-07, 18:29 #12
Salva suas paginas como .xhtml ou .xht, que é o padrão de extensão de xhtml no apache. Mudar o mime de paginas html para xhtml não é uma boa solução.

Ted is offline   Reply With Quote
punisher
spkr
 

06-11-07, 19:49 #13
Quote:
Postado por Ted
Salva suas paginas como .xhtml ou .xht, que é o padrão de extensão de xhtml no apache. Mudar o mime de paginas html para xhtml não é uma boa solução.
E se ele não tiver nenhuma página estática e o erro for em um .php ou (ai) .asp? hehe

punisher is offline   Reply With Quote
shogun
Trooper
 

06-11-07, 20:03 #14
se a pagina não for estatica ele tem q programar no codigo da linguagem pra mandar "Content-type: application/xhtml+xml" no header...
em php seria: header("Content-type: application/xhtml+xml");

mas o correto seria fazer uma verificação pra ver se o navegador especificou no HTTP_ACCEPT se ele aceita xhtml, se o navegador não aceitar, manda "Content-type: text/html", mesmo... (senão o navegador pode abrir o dialogo pra baixar o html, ao invés de exibir a pagina)

shogun is offline   Reply With Quote
punisher
spkr
 

06-11-07, 20:27 #15
ae shogun, eu sei que o lance de acessibilidade é interessante, que é bom deixar o mais flexível quanto possível, mas cara, me diz um navegador que não aceita xhtml e quantos % dos internautas ainda usam

punisher is offline   Reply With Quote
shogun
Trooper
 

06-11-07, 20:59 #16
o problema não é não aceitar xhtml, já que xhtml na pratica eh html, mas sim aceitar o mime correto do xhtml

qual browser não aceita: Internet Explorer
qtos % ainda usam: ~83%

shogun is offline   Reply With Quote
GoldenEye
Trooper
 

06-11-07, 21:13 #17
Code:
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
vc tem isso no seu header?

esse erro parece mais do HTTP GET da aplicacao

GoldenEye is offline   Reply With Quote
GoldenEye
Trooper
 

06-11-07, 21:20 #18
agora q eu vi ali o teu
to viajando aqui
coloca esses headers e mais aquele que o bomba falou

GoldenEye is offline   Reply With Quote
punisher
spkr
 

07-11-07, 10:27 #19
Quote:
Postado por shogun
o problema não é não aceitar xhtml, já que xhtml na pratica eh html, mas sim aceitar o mime correto do xhtml

qual browser não aceita: Internet Explorer
qtos % ainda usam: ~83%
só se for ie5, todos os meus scripts tem mime application/xhtml e nenhum deles aparece pra download quando entro na página

punisher is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
07-11-07, 10:32 #20
Quote:
Postado por Ted
Salva suas paginas como .xhtml ou .xht, que é o padrão de extensão de xhtml no apache. Mudar o mime de paginas html para xhtml não é uma boa solução.
Mas é PHP, Ted.
Tá, eu sei que o PHP admite qualquer extensão, mas fica bizarro... AEhUAHEu!
Vamos ver...

night is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
07-11-07, 10:40 #21
Quote:
Postado por shogun
se a pagina não for estatica ele tem q programar no codigo da linguagem pra mandar "Content-type: application/xhtml+xml" no header...
em php seria: header("Content-type: application/xhtml+xml");

mas o correto seria fazer uma verificação pra ver se o navegador especificou no HTTP_ACCEPT se ele aceita xhtml, se o navegador não aceitar, manda "Content-type: text/html", mesmo... (senão o navegador pode abrir o dialogo pra baixar o html, ao invés de exibir a pagina)
Vou testar esse header que você passou, shogun. Obrigado.

night is offline   Reply With Quote
punisher
spkr
 

07-11-07, 10:41 #22
night, você por um acaso tentou alguma das soluções que o validador te apresentou?
em qual host tá isso, talvez você realmente precise configurar o apache
e
tentou colocar header("Content-type: application/xhtml+xml"); no seu script, como o shogun disse?

edit: um minuto atrasado

punisher is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
07-11-07, 10:48 #23
Pupu, aí que tá... eu tô achando que realmente vai precisar mexer no cfg do Apache. Mas ainda não tenho certeza.

Essa última opção do header eu ainda não testei... e agora, por alguma razão obscura, não estou conseguindo concetar o FTP... ahuahuhauhau!

night is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
07-11-07, 11:07 #24
AAAAAEEEEEEE! Funcionou o header... valeu shogun!

Maizim pra todo mundo que ajudou.

E se desse pra dar negativo seria pro didz, que além de burro é corneteiro.

=*

night is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
07-11-07, 11:26 #25
Pô, só não consegui positivar o Golden... You must spread some Reputation around before giving it to GoldenEye again.

night is offline   Reply With Quote
shogun
Trooper
 

07-11-07, 11:29 #26
Quote:
Postado por Nightwolf
AAAAAEEEEEEE! Funcionou o header... valeu shogun!

Maizim pra todo mundo que ajudou.

E se desse pra dar negativo seria pro didz, que além de burro é corneteiro.

=*
tentou abrir a página no IE?
ele vai mostrar o dialogo de download...
como eu disse, tem fazer uma verificação, coloca isso no lugar:

PHP Code:
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
  
header("Content-type: application/xhtml+xml");
}
else {
  
header("Content-type: text/html");

*roubei o código de algum lugar na net

shogun is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
07-11-07, 11:40 #27
É mesmo, shogun...



AHeuHAUehAU!

E outra coisa: ficou um espaço entre o topo da página e HTML (em branco), como se o código header do PHP fizesse parte da página... como resolve isso?

Mas cara, testei esse exemplo que você citou ali e não funcionou. Continua dando um warning referente ao Mime Type na validação.


Last edited by night; 07-11-07 at 11:52..
night is offline   Reply With Quote
Snowfox
Trooper
 

08-11-07, 00:13 #28
cara.. não é o apache isso... é no teu documento mesmo.

tu não consegue receber o validator tabajara por causa do warning ?

[]'s

Snowfox is offline   Reply With Quote
night
Engineer
 

PSN ID: lcsaboia Steam ID: luzion
08-11-07, 12:11 #29
O Validator eu recebo. Ele não contém nenhum erro. Mas tem esse Warning.
Mas foda-se, cheguei à conclusão de que não vale a pena corrigir esta merda... mta diferença entre os browsers... aHEuHAEuHAU

night is offline   Reply With Quote
Responder

Thread Tools

Regras de postagem
Você não pode criar novos tópicos
Você não pode postar
Você não pode enviar anexos
Você não pode editar seus posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Atalho para Fóruns



O formato de hora é GMT -3. horário: 10:43.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.