1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4 <xsl:template match="text()"/>
6 {{function clause_xpath}}
7 {{if !$clause.attribute}}
8 {{$clause.element}}{{elseif $clause.attribute == 'class'}}
9 {{$clause.element}}[contains(concat(' ', normalize-space(@class), ' '), '{{$clause.value}}')]{{else}}
10 {{$clause.element}}[@{{$clause.attribute}}='{{$clause.value}}']{{/if}}
13 {{foreach $spec.include as $clause}}
14 <xsl:template match="{{clause_xpath clause=$clause}}">
16 <xsl:apply-templates select="node()|@*" mode="remove"/>
21 {{foreach $spec.exclude as $clause}}
22 <xsl:template match="{{clause_xpath clause=$clause}}" mode="remove"/>
25 <xsl:template match="node()|@*" mode="remove">
27 <xsl:apply-templates select="node()|@*" mode="remove"/>