FireFox and IE render XSLT documents differently
I'm not an XML "expert", but I am trying to get there. I recently attempted to write my first transformation document and I thought it was going pretty well as evidenced by my beautiful result in IE...
When I attempted to verify like results in other browsers, though, it all fell apart. My guess is that I coded something improperly against the XSLT standard and IE guessed my intentions and displayed it.
Obviously I don't know what the problem is, but I have a couple guesses. My bet is that it has something to do with the DOCTYPE ENTITY I declared, probably deprecated or something, but IE still renders it. Based on what I think MIGHT be the problem, I'll include the file texts where I believe the issue lies, but if someone needs more information, I'm happy to include more details.
I didn't include the entire xslt for space sake, also I'm 99.9% sure that the problem is not with the xslt, but with one of the other 3 files I included in their entirety.
I'm 开发者_StackOverflowsincerely thankful for any assistance in advance.
index.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0;url=conf/contentNavMenu.xml">
<title>SmartBook</title>
</head>
<body>
</body>
</html>
contentNavMenu.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../smartbook.xsl"?>
<!DOCTYPE smartbook [
<!ENTITY navigationMenu SYSTEM "smartbookLinks.xml">
]>
<smartbook>
<navMethod>JS</navMethod>
&navigationMenu;
</smartbook>
smartbookLinks.xml
<?xml version="1.0" encoding="utf-8"?>
<menu>
<menuItem>
<id>1</id>
<text>Problem Identification</text>
<subMenu>
<navalturl>navalt/1.html</navalturl>
<menuItem>
<id>1.1</id>
<text>Identify a real world need.</text>
<url></url>
<target>_blank</target>
<details>Details 1.1</details>
</menuItem>
<menuItem>
<id>1.2</id>
<text>Identify specific area of the identified need.</text>
<url></url>
<target>_blank</target>
<details>Details 1.2</details>
</menuItem>
</subMenu>
</menuItem>
<menuItem>
<id>2</id>
<text>Risk Identification and Mitigation</text>
<subMenu>
<navalturl>navalt/2.html</navalturl>
<menuItem>
<id>2.1</id>
<text>Text 2.1</text>
<url></url>
<target>_blank</target>
<details>Details 2.1</details>
</menuItem>
</subMenu>
</menuItem>
</menu>
smartbook.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<link href="../css/smartbook.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/sb_navigation.js"></script>
</head>
<body style="margin-top:4px;">
...content omitted...
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Firefox doesn't load external entities. See developer.mozilla.org/en/XML_in_Mozilla for details.
精彩评论