I'm trying to use the XSL filter that was added in Nanoc 3.3, but I keep running into this error:
RuntimeError: compilation error: element site
xsltParseStylesheetProcess : document is not a stylesheet
I can force the same error if I run xsltproc on the commandline with the arguments reversed (i.e. "xsltproc content/content.xml layouts/master.xsl" rather than the correct "xsltproc layouts/master.xsl content/content.xml"), so it feels like something in the Nokogiri integration is wrong, but I can't quite pinpoint it. Has anyone else experienced this error? Or has anyone successfully used the XSL filter?
This is what I've pared my setup down to:
content/content.xml:
<?xml version="1.0" encoding="utf-8" ?>
<site>
<page>
<h1>Blogpost</h1>
</page>
</site>
layouts/master.xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:output omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/">
<xsl:value-of select="site/page/h1"/>
</xsl:template>
</xsl:stylesheet>
Rules:
compile '*' do
layout 'master'
end
route '*' do
item.identifier.chop + '.' + item[:extension]
end
layout '/master/', :xsl
...and this is the full error:
RuntimeError: compilation error: element site
xsltParseStylesheetProcess : document is not a stylesheet
Compilation stack:
- [item] /content/ (rep default)
Stack trace:
0. /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/lib/nokogiri/xslt.rb:32:in `parse_stylesheet_doc'
1. /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/lib/nokogiri/xslt.rb:32:in `parse'
2. /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.5/lib/nokogiri/xslt.rb:13:in `XSLT'
3. /Library/Ruby/Gems/1.8/gems/nanoc-3.4.2/lib/nanoc/filters/xsl.rb:39:in `run'
4. /Library/Ruby/Gems/1.8/gems/nanoc-3.4.2/lib/nanoc/base/result_data/item_rep.rb:413:in `layout'
5. /Library/Ruby/Gems/1.8/gems/nanoc-3.4.2/lib/nanoc/base/compilation/item_rep_proxy.rb:69:in `layout'
6. /Library/Ruby/Gems/1.8/gems/nanoc-3.4.2/lib/nanoc/base/compilation/rule_context.rb:67:in `layout'
7. ./Rules:22:in `load'
8. /Library/Ruby/Gems/1.8/gems/nanoc-3.4.2/lib/nanoc/base/compilation/rule.rb:68:in `instance_eval'
9. /Library/Ruby/Gems/1.8/gems/nanoc-3.4.2/lib/nanoc/base/compilation/rule.rb:68:in `apply_to'
... 23 more lines omitted. See full crash log for details.
Can anyone spot a problem? Am I doing something wrong?