Skip site navigation (1) Skip section navigation (2)

Re: Report stylesheet bug (was: [pgadmin-support] Insert the SQL

From: Dave Page <dpage(at)postgresql(dot)org>
To: Ezequias Rodrigues da Rocha <ezequias(dot)rocha(at)gmail(dot)com>
Cc: "pgadmin-support(at)postgresql(dot)org" <pgadmin-support(at)postgresql(dot)org>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Report stylesheet bug (was: [pgadmin-support] Insert the SQL
Date: 2006-11-23 16:18:17
Message-ID: 4565C9C9.5030907@postgresql.org (view raw or flat)
Thread:
Lists: pgadmin-hackerspgadmin-support
Ezequias Rodrigues da Rocha wrote:
> I say comments not Report Notes.
> 
> Source and Comment are definetly not ok.
> 
> See my attached image.

Ahh, sorry - misread your message. After spending an hour or so trying 
to figure it out with one of the guys here, I've come to the conclusion 
that we simply don't know why it's broken (I'm far from an expert in 
XSL). If anyone has an idea, I'm all ears...

The stylesheet can be found at 
http://www.pgadmin.org/docs/1.6/default-xsl.html - the problem appears 
to be in the last two template, the first of which should call the 
second but apparently does not. The second is used for the notes and SQL 
at the bottom of the reports so is obviously not totally broken:

<xsl:template match="*" mode="cells">
   <xsl:param name="row" />
     <td class="ReportTableValueCell">
     <xsl:choose>
       <xsl:when test="$row/@*[name() = current()/@id]|$row/*[name() = 
current()/@id] != ''">
         <xsl:call-template name="substitute">
           <xsl:with-param name="string" select="$row/@*[name() = 
current()/@id]|$row/*[name() = current()/@id]" />
         </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
         <xsl:text> </xsl:text>
       </xsl:otherwise>
     </xsl:choose>
   </td>
</xsl:template>

<xsl:template name="substitute">
    <xsl:param name="string" />
    <xsl:param name="from" select="'&#xA;'" />
    <xsl:param name="to">
       <br />
    </xsl:param>
    <xsl:choose>
       <xsl:when test="contains($string, $from)">
          <xsl:value-of select="substring-before($string, $from)" />
          <xsl:copy-of select="$to" />
          <xsl:call-template name="substitute">
             <xsl:with-param name="string" 
select="substring-after($string, $from)" />
             <xsl:with-param name="from" select="$from" />
             <xsl:with-param name="to" select="$to" />
          </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
          <xsl:value-of select="$string" />
       </xsl:otherwise>
    </xsl:choose>
</xsl:template>

Regards, Dave.

In response to

Responses

pgadmin-hackers by date

Next:From: Ezequias Rodrigues da RochaDate: 2006-11-23 18:10:47
Subject: Re: Report stylesheet bug (was: [pgadmin-support] Insert the SQL
Previous:From: svnDate: 2006-11-23 16:09:17
Subject: SVN Commit by dpage: r5683 - branches/REL-1_6_0_PATCHES/pgadmin3/src/utils

pgadmin-support by date

Next:From: Ezequias Rodrigues da RochaDate: 2006-11-23 18:10:47
Subject: Re: Report stylesheet bug (was: [pgadmin-support] Insert the SQL
Previous:From: Dave PageDate: 2006-11-23 14:32:59
Subject: Re: Insert the SQL in the report [not working]

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group