Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml XSLT在IE中工作,而不是在Chrome或Firefox中_Xml_Google Chrome_Firefox_Xslt_Xml Namespaces - Fatal编程技术网

Xml XSLT在IE中工作,而不是在Chrome或Firefox中

Xml XSLT在IE中工作,而不是在Chrome或Firefox中,xml,google-chrome,firefox,xslt,xml-namespaces,Xml,Google Chrome,Firefox,Xslt,Xml Namespaces,给定一个正常的nhibernate配置文件: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="http://localhost/xmlStylesheets/nhibernate.xsl"?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory>

给定一个正常的nhibernate配置文件:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://localhost/xmlStylesheets/nhibernate.xsl"?>

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
    <property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
    <property name="connection.connection_string">Data Source=MyDB;User ID=MyUser;Connection Lifetime=0;Enlist=false;Pooling=true;Max Pool Size=100;Min Pool Size=0;Incr Pool Size=5;Decr Pool Size=1;Statement Cache Size=100;</property>
    <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
    <property name="use_outer_join">true</property>
    <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
    <property name="show_sql">true</property>
  </session-factory>
</hibernate-configuration>

NHibernate.Connection.DriverConnectionProvider
NHibernate.方言
NHibernate.Driver.OracleDataClientDriver
数据源=MyDB;用户ID=MyUser;连接寿命=0;登记=假;池=真;最大池大小=100;最小池大小=0;增量池大小=5;decrpool Size=1;语句缓存大小=100;
NHibernate.ByteCode.Castle.proxyFactory,NHibernate.ByteCode.Castle
真的
真1,假0,是“Y”,否“N”
真的
我为它创建了一个xslt转换

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:h="urn:nhibernate-configuration-2.2">
  <xsl:template match="h:hibernate-configuration/h:session-factory">
    <html>
      <head>
        <title>Projects</title>
        <link rel="Stylesheet" type="text/css" 
              href="http://localhost/xmlStylesheets/xml.css" />
      </head>
      <body>
        <div id="container">
          <div class="content" id="settings">
            <xsl:value-of select="count(h:property)" /> properties
            <table class="grid">
              <thead>
                <tr>
                  <th>Property</th>
                  <th>Value</th>
                </tr>
              </thead>
              <tbody>
              <xsl:for-each select="h:property">
                <tr>
                  <td><xsl:value-of select="@name" /></td>
                  <td><xsl:value-of select="." /></td>
                </tr>
              </xsl:for-each>
              </tbody>
            </table>
          </div>
        </div>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

项目
性质
财产
价值

这在IE中运行良好,但在chrome或firefox中无法呈现。知道问题是什么吗?

您的Web服务器应该返回正确的mime类型,xsl工作表才能正常工作

Mozilla需要
text/xml
application/xml
,如中所述

chrome似乎也将与
application/xml
配合使用


很多时候都是这样,IE不像其他浏览器那样挑剔,并且对
text/xsl

感到满意。它在Opera10.10、chromium 4.0、firefox 3.6和ie8中对我来说非常有用。我得到这个输出:

8 properties
Property    Value
connection.provider NHibernate.Connection.DriverConnectionProvider
dialect NHibernate.Dialect.Oracle10gDialect
connection.driver_class NHibernate.Driver.OracleDataClientDriver
connection.connection_string    Data Source=MyDB;User ID=MyUser;Connection         Lifetime=0;Enlist=false;Pooling=true;Max Pool Size=100;Min Pool Size=0;Incr Pool Size=5;Decr Pool Size=1;Statement Cache Size=100;
proxyfactory.factory_class  NHibernate.ByteCode.Castle.ProxyFactoryFactory,         NHibernate.ByteCode.Castle
use_outer_join  true
query.substitutions true 1, false 0, yes 'Y', no 'N'
show_sql    true

有趣。我从未遇到过这样的问题,所以很高兴知道这可能是个问题。谢谢另外,我直接浏览文件。一旦我把它放到web服务器上并修复了mime类型,它就可以在非ie浏览器中工作了。谢谢对我来说,
text/xml
application/xml
在chrome中都不起作用。它只显示一个白色屏幕。你能猜出原因吗?@Manish-guess?chrome中的Bug?Chrome开发者没有实现它?你需要问问chrome开发者为什么它不起作用。