Edgewall Software

Opened 17 years ago

Closed 17 years ago

#170 closed defect (invalid)

py:if doesn't work inside matched content

Reported by: goldschr@… Owned by: cmlenz
Priority: major Milestone:
Component: General Version: 0.4.4
Keywords: Cc:

Description

py:if does not appear to work inside matched content. Using the following templating style which pulls data from child XML files, I run into problems:

# master.html
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:py="http://genshi.edgewall.org/"
  py:strip="True"
  lang="en">
  
<head py:match="head">
    <title>${select('title/text()')} - My Site</title>
</head>
<body py:match="body" py:attrs="select('@*')">
    <div py:if="False">This shouldn't appear</div>

    <div style="background-color: #eee;">
        ${select('*|text()')}
    </div>
</body>
</html>
# index/index.html
<!DOCTYPE html
  PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:py="http://genshi.edgewall.org"
  xmlns:xi="http://www.w3.org/2001/XInclude">

<xi:include href="../master.html" />

<head>
    <title>Home</title>
</head>
<body>
    <p>Test Page</p>
    
    <div py:if="False">This shouldn't appear</div>
</body>
</html>

"This shouldn't appear" appears inside index.html.

Change History (1)

comment:1 Changed 17 years ago by cmlenz

  • Milestone 0.5 deleted
  • Resolution set to invalid
  • Status changed from new to closed

In index.html, the py namespace URI is missing the trailing slash. Thus the py:if directive does not get processed.

Note: See TracTickets for help on using tickets.