Comment by em-bee
2 months ago
for the record for anyone finding this in the future. this example works in firefox, but not in chromium. there it loads the page and the xsl stylesheet, but it displays an empty page.
a more elaborate example has the same results. chromium is empty. firefox works except that it looks like attributes to tags in the main content are ignored, which prevents css classes or links from working and images from loading. both work in the menu that is included from the template.
found it: the problem was that <xsl:copy><xsl:apply-templates/></xsl:copy> doesn't copy attributes. it needs to be:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
oh, and the inspector doesn't work with my example, making this thing hard to debug. xsl support in the browser appears to be limited. and unfortunately, if i can't get it to work in chrome, i won't be able to use it.
No comments yet
Contribute on Hacker News ↗