Ich habe einen XPath-Ausdruck, der in Firefox gut funktioniert, aber wenn ich die Datei in IE betrachte, habe ich einen Fehler bekommen. Gibt es einen Workaround, damit IE meinen Ausdruck verstehen kann?XPath-Ausdruck in xsl-Datei funktioniert nicht in IE
Mein XSL (ich entfernte viel, so dass es ein bisschen einfacher zu sehen ist).
<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="#all" >
\t <xsl:output indent="yes"/>
\t <xsl:output method="html" encoding="UTF-8"/>
\t <xsl:template match="/">
\t \t <html>
\t \t \t <head>
\t \t \t \t <title>
\t \t \t \t \t <xsl:value-of select="versions/project" />
\t \t \t \t </title>
\t \t \t \t <style type="text/css">
\t \t \t \t \t ...
\t \t \t \t </style>
\t \t \t </head>
\t \t \t <body>
\t \t \t \t <div class="content">
\t \t \t \t \t
\t \t \t \t \t \t \t \t <xsl:for-each select="/releasenotes/notes/note[component/@type=$unitTag]">
\t \t \t \t \t \t \t \t \t <xsl:for-each select=".[component/@number=$versionNumber and text/@type='new']">
\t \t \t \t \t \t \t \t \t \t <li type="disc">
\t \t \t \t \t \t \t \t \t \t \t <xsl:value-of select="text" />
\t \t \t \t \t \t \t \t \t \t \t <xsl:for-each select="component[not(@type=$unitTag)]">
\t \t \t \t \t \t \t \t \t \t \t \t <xsl:sort select="@type" order="ascending"/>
\t \t \t \t \t \t \t \t \t \t \t \t , <a href="#{@type}_{@number}">
\t \t \t \t \t \t \t \t \t \t \t \t \t <xsl:variable name="unitType" select="@type"/>
\t \t \t \t \t \t \t \t \t \t \t \t \t <xsl:value-of select="//components/component[tag=$unitType]/name" /> (<xsl:value-of select="@number" />)
\t \t \t \t \t \t \t \t \t \t \t \t </a>
\t \t \t \t \t \t \t \t \t \t \t </xsl:for-each>
\t \t \t \t \t \t \t \t \t \t </li>
\t \t \t \t \t \t \t \t \t </xsl:for-each>
\t \t \t \t \t \t \t \t </xsl:for-each>
\t \t \t \t \t \t \t
\t \t \t \t \t \t </xsl:for-each>
\t \t \t \t \t </xsl:for-each>
\t \t \t \t \t
\t \t \t \t </div>
\t \t \t </body>
\t \t </html>
\t </xsl:template>
</xsl:stylesheet>
Das Problem scheint in dieser Linie zu sein:
<xsl:for-each select=".[component/@number=$versionNumber and text/@type='new']">
in diesem Fehler führt:
Expected token 'EOF' found '['. .-->[<--component/@number='$versionNumber' and text/@type='new']