Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (25 sloc) 651 Bytes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Filter for trimming "select" attributes from some tags that contains
child elements
@author Sergey Chikuyonok (
import re
tags = {
'xsl:variable': 1,
'xsl:with-param': 1
re_attr = re.compile(r'\s+select\s*=\s*([\'"]).*?\1')
def trim_attribute(node):
Removes "select" attribute from node
@type node: ZenNode
node.start = re_attr.sub('', node.start)
def process(tree, profile):
for item in tree.children:
if item.type == 'tag' and in tags and item.children:
process(item, profile)