使用HTML5的doctype与链接到<iframe src="..."></iframe>
URL中标记一个XML声明:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml" xml:lang="en">
<!--...-->
</html>
因此,当XML内容的IFRAME内举办,树视图不会自动被生成默认。但是,当浏览器在兼容性视图中运行时,IE会尝试更加仔细地模拟以前版本的行为,这就是为什么在这些情况下树视图仍然显示的原因。
或XSLT:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="html5.xml"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
>
<xsl:output method="xml" encoding="utf-8" version="" indent="yes" standalone="no" media-type="text/html" omit-xml-declaration="no" doctype-system="about:legacy-compat" />
<xsl:template match="xsl:stylesheet">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
These<br/>words<br/>are<br/>seperated<br/>by<br/>BRs
</body>
</html>
</xsl:template>
</xsl:stylesheet>
参考