Edgewall Software

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#293 closed defect (fixed)

XPath matching wrong following r998 (or its trunk cousin)

Reported by: osimons Owned by: cmlenz
Priority: blocker Milestone: 0.6
Component: XPath support Version: devel
Keywords: Cc:

Description

I have a site.html for Trac that replaces some help text/links that gets rendered. It has been working well 'forever'. Now following update to latest 0.5.x, the following (shortened) example no longer works:

<!--! Help text: ticket.html - TracTickets replacement -->
<div py:match="div[@id='content' and @class='ticket']/div[@id='help']">
  This text should replace default help text.
</div>

As a workaround, I either have to use slightly older Genshi (pre r998), or change the xpath query to use two * // that then finds a match (and risk finding wrong content):

<div py:match="div[@id='content' and @class='ticket']//div[@id='help']">

As seen, it changes the help div of ticket template - and as can be seen from this very ticket page, the 'help' div is a direct child of 'content'. This regression will likely break a lot of existing XPath expressions.

Change History (4)

comment:1 Changed 15 years ago by cmlenz

  • Status changed from new to assigned

This seems to be caused by [914]. Not sure what's happening here, yet.

comment:2 Changed 15 years ago by cmlenz

  • Priority changed from major to blocker

comment:3 Changed 15 years ago by cmlenz

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

Fixed by reverting [914] in [1011] (trunk) and [1012] (0.5.x). Would still be nice to figure out why that change doesn't work in this case, though :P

comment:4 Changed 14 years ago by cmlenz

  • Milestone changed from 0.5.2 to 0.6

Milestone 0.5.2 deleted

Note: See TracTickets for help on using tickets.