2011-08-08 2 views
1

내 XHTML5 페이지에서 IE의 단점 모드가 발생하는 이유는 무엇입니까? , http://www.w3.org/MarkUp/2004/xhtml-faq#ie에서 그런내 XHTML5 페이지에서 IE의 단점 모드가 발생하는 이유는 무엇입니까?

<?php header('Content-Type: application/xml;charset=UTF-8'); ?> 
<?php echo '<?';?>xml version="1.0" encoding="UTF-8"?> 
<?php echo '<?';?>xml-stylesheet type="text/xsl" href="ie-xhtml-fix.xsl"?> 
<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr"> 
<head><meta charset="UTF-8" /> 

IE-XHTML-fix.xsl이다 : 여기서

는 MIME 타입과 <?를 전송 DOCTYPE 등을 포함 PHP이다 미안

<stylesheet version="1.0" 
    xmlns="http://www.w3.org/1999/XSL/Transform"> 
    <template match="/"> 
     <copy-of select="."/> 
    </template> 
</stylesheet> 

나는 물어야한다. 이 문제를 파악할 수없는 것 같습니다. 문제의 원인이 될 수있는 정보를 찾을 수 없습니다. 나는 그것이 IE7 이상에서 작동하기를 바라고 있습니다.

+0

W3C 검사기를 통해 페이지를 실행하셨습니까? – Spudley

+0

네, 유효성을 완전히 검사하고 있습니다. – Torneo

+1

... XHTML5? HTML5와 XHTML1.1이 있지만 XHTML5는 없습니다. – Nightfirecat

답변

2

문제는 XSLT 템플릿이 처리 명령을 출력으로 복사하고있는 것으로 보입니다. 즉, 처리 명령이 doctype 전에 IE에서 구문 분석되어 IE가 Quirks 모드로 들어가는 것을 의미합니다.

대신이 XSLT을 시도해보십시오

<stylesheet version="1.0" 
    xmlns="http://www.w3.org/1999/XSL/Transform"> 
    <output method="html" version="1.0" encoding="UTF-8" doctype-system="about:legacy-compat" /> 

    <!-- Copy all the child nodes of the root --> 
    <template match="/"> 
     <copy> 
      <apply-templates select="node()|@*"/> 
     </copy> 
    </template> 

    <!-- For any other node, just copy everything --> 
    <template match="node()|@*"> 
     <copy-of select="."/> 
    </template> 

    <!-- For processing instructions directly under the root, discard --> 
    <template match="/processing-instruction()" /> 
</stylesheet> 

테스트 및 IE6에서 이상 작동합니다.