2011-08-08 6 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" /> 

すなわち、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にし、上記の作業します。

関連する問題