XML样式表未在IE9中呈现 [英] Style sheet for XML not rendering in IE9

查看:152
本文介绍了XML样式表未在IE9中呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个xml文档,目前在IE9上甚至都没有将其识别为xml.我尝试添加正确的xmlns:xsl属性,它也具有以

I have a xml document which right now is not even recognized as xml on IE9. I have tried adding correct xmlns:xsl attribute, also it has a correct header starting with

<?xml version="1.0" encoding="UTF-8"?>

此xml在IE 6 7 8中完美呈现,但在IE9中不起作用. 我不确定这是否是Quirks模式相关的问题,如果不确定,那么对于XML文档应该使用哪种DOCTYPE. 任何帮助将不胜感激. 以下是XML文档的前几行.

This xml renders perfectly in IE 6 7 8 but does not work in IE9. I am not sure if it is Quirks mode related issue, and if it is I am not sure what DOCTYPE is should use for XML documents. Any help will be greatly appreciated. Following is the first few lines of XML document.

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/mobiledoc/jsp/empi/master/CCD.xsl" ?>
<ClinicalDocument xmlns="urn:hl7-org:v3" 
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                  xmlns:sdtc="urn:hl7-org:sdtc" 
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                  xsi:schemaLocation="urn:hl7-org:v3 http://xreg2.nist.gov:8080/hitspValidation/schema/cdar2c32/infrastructure/cda/C32_CDA.xsd" 
                  classCode="DOCCLIN" 
                  moodCode="EVN">

推荐答案

您能否更具体地说明它的在IE9上甚至不被识别为xml"吗?您是否收到错误消息,或者仅仅是在IE9中看起来与以前的版本不同?

Can you be more specific as to how it's "is not even recognized as xml on IE9"? Do you get an error message, or is it simply that it looks different in IE9 than in previous versions?

您的XML文件要做的第一件事是将自身与XSLT样式表(位于/mobiledoc/jsp/empi/master/CCD.xsl)相关联,因此这可能是问题的根源.一些建议:

The first thing your XML file does is associate itself with an XSLT stylesheet at "/mobiledoc/jsp/empi/master/CCD.xsl" so this could be the source of your problem. Some suggestions:

  • 作为测试,请除去<?xml-stylesheet .. ?>位.您现在在所有浏览器中都得到相同的行为吗? (可能只是XML文件的分层视图),如果是这样,则问题出在您的XSLT样式表中.

  • As a test, remove the <?xml-stylesheet .. ?> bit. Do you now get the same behaviour in all browsers? (Probably just a hierarchical view of the XML file) If so, then the problem is in your XSLT stylesheet.

该样式表的作用是什么?如果将XML文件转换为HTML,则可能使用的是旧版IE允许的某些不符合规范(X)HTML的结构或样式,而IE9则更严格.如果无法识别"是布局/显示问题,则调整样式表可能会修复您在浏览器中看到的内容.

What does that stylesheet do? If it's converting the XML file into HTML, it might be using some non-conformant (X)HTML constructs or styles which older versions of IE tolerated, but which IE9 is more strict about. If the "not recognized" is some layout/display issue, tweaking the stylesheet might fix what you see in the browser.

根据您到目前为止告诉我们的内容,我认为这可能是您需要开始的地方.

Based on what you've told us so far, I think that's probably where you need to start.

ETA:以下对话的结果是<xsl:output>指令将4.01 HTML文档类型强制输入到输出中.将其更改为<xsl:output method="html"/>(并解决了转换中的其他几个问题)可解决IE9中的问题.

ETA: The upshot of the conversation below was that the <xsl:output> directive was forcing a 4.01 HTML doctype into the output; changing this to <xsl:output method="html"/> (and fixing a couple of other issues with the transform) fixed the problem in IE9.

这篇关于XML样式表未在IE9中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆