如何强制xsl仅在兼容模式下呈现 [英] How to force xsl to render in Compatibility mode only
本文介绍了如何强制xsl仅在兼容模式下呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有
我有一个XML文件在IE 10和11中无法正确呈现,我如何强制xsl仅在兼容模式下呈现。
what我需要在XSL中进行更改以便在兼容模式下呈现它
这是我的XSL
Dear all
I have a XML file which is not render properly in IE 10 and 11, How can I force xsl to render in Compatibility mode only.
what changes do I need to make in XSL to render it in compatibility mode always
Here is my XSL
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xlink-ectd="http://www.w3c.org/1999/xlink">
<xsl:template match="/">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=9, chrome=1"/>
<title>Study Tagging File (STF)</title>
</head>
<body>
<h2>Study Tagging File (STF)</h2>
<!-- The following table provides the study properties-->
<table frame="hsides" width="80%">
<tr>
<td colspan="2">Study Title:</td>
<td width="50%"><xsl:value-of select="//study-identifier/title"/></td>
</tr>
<tr>
<td colspan="2">Study ID:</td>
<td><xsl:value-of select="//study-identifier/study-id"/></td>
</tr>
<tr>
<td colspan="3">Category:</td>
</tr>
<xsl:apply-templates select="//category"/>
</table>
<xsl:apply-templates select="//study-document"/>
</body>
</html>
</xsl:template>
<xsl:template match="category">
<xsl:variable name="name" select="@name"/>
<xsl:variable name="realm" select="@info-type"/>
<xsl:variable name="value" select="."/>
<tr>
<xsl:if test="count(document('valid-values.xml')//category[./@name=$name]/valid-value[./@realm=$realm and ./@value=$value]) = 0">
<xsl:attribute name="bgcolor">#FF6666</xsl:attribute>
</xsl:if>
<td width="10%" align="right">[<xsl:value-of select="@info-type"/>]</td>
<td width="40%"><xsl:value-of select="@name"/></td>
<td width="50%"><xsl:value-of select="."/></td>
</tr>
</xsl:template>
<xsl:template match="study-document">
<table frame="hsides" width="80%">
<tr>
<td colspan="4">Study Content:</td>
</tr>
<xsl:apply-templates select="doc-content|content-block"/>
</table>
</xsl:template>
<xsl:template match="doc-content">
<!--This section extracts information from the eCTD backbone file if it is located correctly at the sequence folder root-->
<!--This section creates an xLink pointer to the eCTD backbone leaf through its ID attribute value using the STF file's ectd-leaf-id-value as the source for the leaf's ID attribute value-->
<xsl:variable name="backbone-from-stf"><xsl:value-of select="substring-before(@xlink:href, '#')"/></xsl:variable>
<xsl:variable name="path-from-stf" select="substring-before($backbone-from-stf, 'index.xml')"/>
<xsl:variable name="doc-id" select="substring-after(@xlink:href, '#')"/>
<xsl:variable name="doc-ref" select="document($backbone-from-stf)//leaf[./@ID=$doc-id]/@xlink-ectd:href"/>
<xsl:variable name="doc-title" select="document($backbone-from-stf)//leaf[./@ID=$doc-id]/title"/>
<xsl:variable name="path-to-file" select="concat($path-from-stf,$doc-ref)"/>
<tr>
<td valign="top" width="20%">Document Title:</td>
<td valign="top" width="30%"><xsl:value-of select="$doc-title"/></td>
<td valign="top" width="20%">Relative Filename:</td>
<td valign="top" width="30%">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$path-to-file"/></xsl:attribute>
<xsl:value-of select="$doc-ref"/>
</xsl:element>
<br/>
</td>
</tr>
<xsl:apply-templates select="property"/>
<xsl:apply-templates select="file-tag"/>
</xsl:template>
<xsl:template match="content-block">
<tr>
<td colspan="4">
<table border="1" width="60%">
<tr>
<td>Block Title:</td>
<td colspan="2"><xsl:value-of select="block-title"/></td>
</tr>
<xsl:apply-templates select="property"/>
<xsl:apply-templates select="file-tag"/>
<xsl:apply-templates select="doc-content|content-block"/>
</table>
</td>
</tr>
</xsl:template>
<xsl:template match="property">
<xsl:variable name="name" select="@name"/>
<xsl:variable name="realm" select="@info-type"/>
<tr>
<xsl:if test="count(document('valid-values.xml')//property/valid-value[./@realm=$realm and ./@value=$name]) = 0">
<xsl:attribute name="bgcolor">#FF6666</xsl:attribute>
</xsl:if>
<td/>
<td align="right">[<xsl:value-of select="@info-type"/>]</td>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="."/></td>
</tr>
</xsl:template>
<xsl:template match="file-tag">
<xsl:variable name="name" select="@name"/>
<xsl:variable name="realm" select="@info-type"/>
<tr>
<xsl:if test="count(document('valid-values.xml')//file-tag/valid-value[./@realm=$realm and ./@value=$name]) = 0">
<xsl:attribute name="bgcolor">#FF6666</xsl:attribute>
</xsl:if>
<td/>
<td align="right">[<xsl:value-of select="@info-type"/>]</td>
<td colspan="2"><xsl:value-of select="@name"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>
here is xml
here is xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="ich-stf-stylesheet-2-2a.xsl"?>
<ectd:study xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="2.2" xmlns:ectd="http://www.ich.org/ectd">
<study-identifier>
<title>Study std2015: std2015d</title>
<study-id>std2015</study-id>
</study-identifier>
<study-document>
<doc-content xlink:href="../../../../../../0001/index.xml#AG10871S1" xlink:type="simple">
<file-tag name="adverse-event-listings" info-type="ich" />
</doc-content>
</study-document>
</ectd:study>
推荐答案
name]/valid-value[./@realm=
name]/valid-value[./@realm=
realm and ./@value=
realm and ./@value=
value]) = 0\">
\t\t\t\t<xsl:attribute name=\"bgcolor\">#FF6666</xsl:attribute>
\t\t\t</xsl:if>
\t\t\t<td width=\"10%\" align=\"right\">[<xsl:value-of select=\"@info-type\"/>]</td>
\t\t\t<td width=\"40%\"><xsl:value-of select=\"@name\"/></td>
\t\t\t<td width=\"50%\"><xsl:value-of select=\".\"< span class=\"code-keyword\">/></td>
\t\t</tr>
\t</xsl:template>
\t
\t<xsl:template match=\"study-document\">
\t\t<table frame=\"hsides\" width=\"80%\">
\t\t\t<tr>
\t\t\t\t<td colspan=\"4\">Study Content:</td>
\t\t\t</tr>
\t\t\t<xsl:apply-templates select=\"doc-content|content-block\"/>
\t\t</table>
\t</xsl:template>
\t
\t<xsl:template match=\"doc-content\">
\t\t<!--This section extracts information from the eCTD backbone file if it is located correctly at the sequence folder root-->
\t\t<!--This section creates an xLink pointer to the eCTD backbone leaf through its ID attribute value using the STF file's ectd-leaf-id-value as the source for the leaf's ID attribute value-->
\t <xsl:variable name=\"backbone-from-stf\"><xsl:value-of select=\"substring-before(@xlink:href, '#')\"/></xsl:variable>
\t\t<xsl:variable name=\"path-from-stf\" select=\"substring-before(
value]) = 0"> <xsl:attribute name="bgcolor">#FF6666</xsl:attribute> </xsl:if> <td width="10%" align="right">[<xsl:value-of select="@info-type"/>]</td> <td width="40%"><xsl:value-of select="@name"/></td> <td width="50%"><xsl:value-of select="."/></td> </tr> </xsl:template> <xsl:template match="study-document"> <table frame="hsides" width="80%"> <tr> <td colspan="4">Study Content:</td> </tr> <xsl:apply-templates select="doc-content|content-block"/> </table> </xsl:template> <xsl:template match="doc-content"> <!--This section extracts information from the eCTD backbone file if it is located correctly at the sequence folder root--> <!--This section creates an xLink pointer to the eCTD backbone leaf through its ID attribute value using the STF file's ectd-leaf-id-value as the source for the leaf's ID attribute value--> <xsl:variable name="backbone-from-stf"><xsl:value-of select="substring-before(@xlink:href, '#')"/></xsl:variable> <xsl:variable name="path-from-stf" select="substring-before(
这篇关于如何强制xsl仅在兼容模式下呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文