Is there any working partial attribute filtering in match templates (i.e., local-name() on attributes)?

13 views
Skip to first unread message

Heiko Wundram

unread,
Jul 24, 2013, 5:20:59 AM7/24/13
to gen...@googlegroups.com
Hey!

I'm currently facing the problem (which I hadn't noticed before) that it seems impossible with built-in means to filter attributes that are applied to a child with select("@*") due to the fact that generic XPath-expressions with local-name() on attributes don't work. This means that transforming something like:

<a image="test" href="#">Test</a>

to

<a href="#"><span class="glyphicons test"><i /></span>Test</a>

is currently impossible using a match template. I'm using the specific test case with glyphicons, because it'd be rather fortunate to be able to define respective elements as attributes of the "a" and not have to resort to a structure as

<a href="#"><image>test</image>Test</a>

which can be transformed, but makes code so much more verbose and confuses the internationalization (as there's a contained tag)... Is there any working patchset for Genshi which implements this? I've seen http://genshi.edgewall.org/ticket/81 which contains a patchset, but that doesn't work for the "simple" cases that I threw at it.

Thanks for any hint!

--- Heiko Wundram.

Simon Cross

unread,
Aug 6, 2013, 3:10:24 PM8/6/13
to gen...@googlegroups.com
Could you perhaps post a complete but small example that you'd expect
to work and I can try suggest something?
Reply all
Reply to author
Forward
0 new messages