﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
85	Static Matching  Implementation	hodgestar+genshi@…	cmlenz	"The syntax for using py:smatch is the same as that for py:match. The py:smatch XPath query is performed immediately after the templated is parsed whereas the py:match query is performed when the template is generated/rendered. In both cases the replacement markup is only created on template generation.

Py:smatch avoids performing XPath matches when the template is generated at the cost of not being able to access the context in the XPath expression or match XML not present in the template file (for example, attributes generated by py:attr).

The implementation includes two new directives SmatchDirective and StaticMatchDirective. SmatchDirective is registered and represents the point in the stream where the py:smatch tag occurs. After parsing the template, a filter (_smatch) is run which removes SmatchDirectives and places StaticMatchDirectives at the points in the stream matched by the SmatchDirective XPath expression.  StaticMatchDirectives then create the new content on template generation.

Note that py:smatch is not as generally useful as I first thought it might be. Not being able to match generated content is in practice a really strong restriction. If others think it's useful, feel free to include it though. :)

The patch (against genshi trunk) includes three tests."	enhancement	new	minor		Template processing	devel		static match	davidf@…
