﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
157	multi-level xi:include causes multiple py:match hits on same target.	chris@…	cmlenz	"File1.html which is some shared fragment of an html file:

{{{
#!genshi
<html xmlns="".."" xmlns:py="".."" xmlns:xi="".."" py:strip="""">
   <div class=""mytarget"">
      Some content.
   </div>
</html>
}}}

File2.html which includes the shared fragment and creates a full html document:

{{{
#!genshi
<html xmlns="".."" xmlns:py="".."" xmlns:xi="".."">
  <body>
    <h1>Some full html document that includes File1.html</h1>
    <xi:include href=""File1.html"" />
  </body>
</html>
}}}

File3.html which creates a second full html document by modifying File2.html through match expressions:

{{{
#!genshi
<html xmlns="".."" xmlns:py="".."" xmlns:xi="".."" py:strip="""">
   <div py:match=""div[@class='target'>"" py:attrs=""select('@*')"">
      Some added stuff.
      ${select('*|text()')}
   </div>
   <xi:include href=""File2.html"" />
</html>
}}}

File3.html will produce:

{{{
#!xml
<html>
  <body>
    <h1>Some full html document that includes File1.html</h1>
    <div class=""mytarget"">
      Some added stuff.
      Some added stuff.
      Some content.
    </div>
  </body>
</html>
}}}

This occurs because the include filter runs all other filters (exec, match, include) on the included document.  That means that match runs twice on File1.html, once for include from File2.html and once for include from File3.html."	defect	closed	major	0.5	Template processing	0.4.4	fixed		
