Edgewall Software

Opened 18 years ago

Last modified 6 years ago

#55 reopened enhancement

Support Python expressions as part of XPath in py:match

Reported by: davidf@… Owned by: cmlenz
Priority: major Milestone:
Component: General Version: devel
Keywords: Cc: simonc+genshi@…

Description

It would be good to be able to specify an XPath as a Python expression (particularly where we're reusing it in multiple places, but this would also allow changing it from Python code) like so:

  <input py:match="${xpath_for_forms}"/>

or

  <input py:match="${create_xpath(valid_attrs)}"/>

Attachments (1)

pymatch-expr.diff (3.3 KB) - added by hodgestar+genshi@… 18 years ago.
Patch against http://svn.edgewall.org/repos/genshi/trunk r466 implements ${} expression handling inside py:match XPath expressions.

Download all attachments as: .zip

Change History (6)

Changed 18 years ago by hodgestar+genshi@…

Patch against http://svn.edgewall.org/repos/genshi/trunk r466 implements ${} expression handling inside py:match XPath expressions.

comment:1 Changed 18 years ago by hodgestar+genshi@…

Patch includes a test. I'm not seeing any performance hit for this on either examples/bench/basic.py or bigtable.py.

comment:2 Changed 18 years ago by hodgestar+genshi@…

All neither benchmark includes any match templates, so that's perhaps not surprising. :/

comment:3 Changed 18 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 18 years ago by cmlenz

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hmm?

comment:5 Changed 15 years ago by Carsten Klein <carsten.klein@…>

see also #91 which is actually a duplicate of this.

Note: See TracTickets for help on using tickets.