Multiple py:match not affecting xi:include

21 views
Skip to first unread message

Micah Stevens

unread,
Oct 22, 2014, 12:49:39 PM10/22/14
to gen...@googlegroups.com

I have a primary genshi template that I'm trying to apply several overrides to in an xsl:fo template:

<py:match path="fo:page-sequence[@master-reference='invoice-sequence']">
...
</py:match>
<xi:include href="main.xml" />


.. This works fine, but when I provide more than one py:match tag, like this:

<py:match path="fo:page-sequence[@master-reference='invoice-sequence']">
...
</py:match>
<py:match path="fo:block[@id='dateF']">
...
</py:match>
<xi:include href="main.xml" />

 


Only the last py:match will work. I can move the xi:include around, and it seems to only be affected by a py:match directly above it, and not at all at the top. What I would expect to work is the include at the top, which starts the stream, and then py:matches after it to modify the stream, but this doesn't seem to be the case, as the py:matches only work if they're placed before the xi:include

Could someone explain to me how to accomplish my goal of using more than one py:match against the xi:include? I'd also love it if there was some theory about includes and py:match so that I could understand why this behaviour is how it seems.


Thank you for any insight into this, or suggestions on how to improve my approach. 

Simon Cross

unread,
Oct 23, 2014, 7:36:38 AM10/23/14
to gen...@googlegroups.com
Could you perhaps provide a minimal example of main.xml that shows the problem?

Micah Stevens

unread,
Oct 24, 2014, 4:23:09 PM10/24/14
to gen...@googlegroups.com
In the interest of brevity, I concocted an example to show you with a much simpler format - which of course worked as expected. So there's some nuance to my full structure which is causing the problem.

Thanks, this gives me a working base to start with, I can probably troubleshoot from here. I'll follow up when I find out what the issue is. 

Appreciate your time getting me on the right track! 
-Micah 

Simon Cross

unread,
Oct 25, 2014, 7:01:32 PM10/25/14
to gen...@googlegroups.com
Np! Keen to hear what the issue was if you discover it. :)
Reply all
Reply to author
Forward
0 new messages