Menu

Help with HTML pan

Help
2003-03-21
2003-11-21
  • Nilesh Shah

    Nilesh Shah - 2003-03-21

    After successful XSLT, the text pan shows the html text, but the html pan doesn't show anything. I was hoping it would redner the html. I couldn't find any option or property related to html pan - is html pan functional in Treebeard?

     
    • Rob

      Rob - 2003-03-21

      Yes it works - there is an oddity with it however that I have been unable to fix. If you have an html, meta or head tag the pane fails to render. I am trying to figure out why.  If you instead leave off / comment out the root html tag meta and head tags when you are previewing all should work well.

       
      • Dan Kuykendall

        Dan Kuykendall - 2003-09-11

        Im seeing this problem as well.
        Any closer to finding the issue?
        This is a darn good tool you have built

         
        • Rob

          Rob - 2003-09-11

          >This is a darn good tool you have built
          Thanks seek3r, nice to hear good news now and again :)
          >Im seeing this problem as well.
          >Any closer to finding the issue?
          The problem seems to be with the basic Java HTML control (I didn't write it Sun did) - i am trying to find a work around - so no not yet hehehe.

          If viewing the html layout is critical to what you're doing, try setting the output to go to your normal system browser (it will look better anyway, style sheets will work, etc). Look under Help / Contents / Beyond the Basics / Changing where the output goes.

          Cheers,
          Rob

           
    • Rob

      Rob - 2003-03-21

      PS - by comment out I mean comment out the tags in the xsl sheet before rendering / merging. The text and html view are rendered at the same time so removeing the tags from the text view does not update the html view. in other words the text pane and html pane are independent of eachother

       
    • Nilesh Shah

      Nilesh Shah - 2003-03-29

      Thanks! I hope you can find the problem. Treebeard is the only product on Linux that I know which will be able to provide an all-in-one XSLT development environment..thanks for the tool

       
    • Morten Grum

      Morten Grum - 2003-11-20

      I'm having the same problem (with one xslt file) that the html isn't showing. I don't understand what you mean by "comment out the tags in the xsl sheet before rendering / merging".

      I've paste the xml file and two xslt files (for both the html is created but only for the second xslt it is shown in the html pan).

      Thanks in advance.

      Morten

      <results group="A">
      <match>
          <date>10-Jun-1998</date>
          <team score="2">Brazil</team>
          <team score="1">Scotland</team>
      </match>
      <match>
          <date>10-Jun-1998</date>
          <team score="2">Morocco</team>
          <team score="2">Norway</team>
      </match>
      <match>
          <date>16-Jun-1998</date>
          <team score="1">Scotland</team>
          <team score="1">Norway</team>
      </match>
      <match>
          <date>16-Jun-1998</date>
          <team score="3">Brazil</team>
          <team score="0">Morocco</team>
      </match>
      <match>
          <date>23-Jun-1998</date>
          <team score="1">Brazil</team>
          <team score="2">Norway</team>
      </match>
      <match>
          <date>23-Jun-1998</date>
          <team score="0">Scotland</team>
          <team score="3">Morocco</team>
      </match>
      </results>

      The first xslt (for which the html IS shown) looks like this ...

      <xsl:transform
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          version="1.0">

      <xsl:variable name="teams" select="//team[not(.=preceding::team)]"/>
      <xsl:variable name="matches" select="//match"/>

      <xsl:template match="results">

      <html><body>
         <h1>Results of Group <xsl:value-of select="@group"/></h1>

         <table cellpadding="5">
            <tr>
              <td>Team</td>
              <td>Played</td>
              <td>Won</td>
              <td>Drawn</td>
              <td>Lost</td>
              <td>For</td>
              <td>Against</td>
            </tr>
         <xsl:for-each select="$teams">
              <xsl:variable name="this" select="."/>
              <xsl:variable name="played" select="count($matches[team=$this])"/>

              <xsl:variable name="won"
                  select="count($matches[team[.=$this]/@score &gt; team[.!=$this]/@score])"/>
              <xsl:variable name="lost"
                  select="count($matches[team[.=$this]/@score &lt; team[.!=$this]/@score])"/>
              <xsl:variable name="drawn"
                  select="count($matches[team[.=$this]/@score = team[.!=$this]/@score])"/>
              <xsl:variable name="for"
                  select="sum($matches/team[.=current()]/@score)"/>
              <xsl:variable name="against"
                  select="sum($matches[team=current()]/team/@score) - $for"/>

              <tr>
              <td><xsl:value-of select="."/></td>
              <td><xsl:value-of select="$played"/></td>
              <td><xsl:value-of select="$won"/></td>
              <td><xsl:value-of select="$drawn"/></td>
              <td><xsl:value-of select="$lost"/></td>
              <td><xsl:value-of select="$for"/></td>
              <td><xsl:value-of select="$against"/></td>
              </tr>
         </xsl:for-each>
         </table>
      </body></html>
      </xsl:template>
      </xsl:transform>

      and the second xslt (for which the html is NOT shown) looks like this

      <xsl:transform
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          version="1.0">
         
          <xsl:template match="results">
              <html>
                  <head>
                      <title> Results of Group <xsl:value-of select="@group"/>
                      </title>
                  </head>
                  <body>
                      <h1> Results of Group <xsl:value-of select="@group"/>
                      </h1>
                      <xsl:apply-templates/>
                  </body>
              </html>
          </xsl:template>
          <xsl:template match="match">
              <h2>
                  <xsl:value-of select="team[1]"/> versus <xsl:value-of select="team[2]"/>
              </h2>
              <p>Played on <xsl:value-of select="date"/>
              </p>
              <p>Result: <xsl:value-of select="team[1] "/>
                  <xsl:value-of select="team[1]/@score"/>, <xsl:value-of select="team[2] "/>
                  <xsl:value-of select="team[2]/@score"/>
              </p>
          </xsl:template>
      </xsl:transform>

       
      • Rob

        Rob - 2003-11-20

        Some xslt parser stick in meta tags when they see the [html] [body] or [title] tag (depending on which you are using I am not sure which tags). If you comment them out one at a time you can find out which is doing it. Look in the "plain" output, if you see any meta tags the html pane wont render the html.

        The html meta pane problem is a sun issue and short of rewritting the whole renderer, I can fix it.

        I just comment out the offending tag in the xslt, and when the sheet is done I uncomment it. If its a problem (or you want better html rendering) you can send the output to a proper browser (mozilla, IE, etc) by using the "Tools/Send Results..." and adding something to the "External Command" box (i.e. mozilla $1)

        Hope that helps.

        Cheers,
        Rob

         
        • Morten Grum

          Morten Grum - 2003-11-21

          Thanks Rob.

          That did the trick. It didn't like the <head> and </head> tags.

          Treabeard is perfect for our need because the xslt style sheets we're going to create/edit will be shown within an application using either the xalan or saxon transformers.

          Thanks.

          Cheers
          Morten

           
    • Rob

      Rob - 2003-11-21

      Thanks for your kind words, and good luck with your project Morten.

      Cheers,
      Rob

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.