Uploaded image for project: 'Forrest'
  1. Forrest
  2. FOR-704

span-template in html2document.xsl doubles span-content

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.8
    • Component/s: Skins (general issues)
    • Labels:
      None
    • Urgency:
      Normal

      Description

      template for span-element traverses to children elements via xsl:apply-templates TWICE!
      once in xsl:choose, than outside
      thus producing doubling the content of span.
      ::
          <xsl:template match="span">
      <xsl:choose>
      <!-- ... -->
      <xsl:otherwise>
      <!-- Strip -->
      <xsl:apply-templates/>
      </xsl:otherwise>
      </xsl:choose>
          
                 <xsl:apply-templates select="./*"/>
          </xsl:template>

        Activity

        Hide
        kronenpj Paul Kronenwetter added a comment -
        Is this similar to the behavior I'm seeing on http://www.cfas.org/? The entire page contents of index.xml/index.html is doubled.
        Show
        kronenpj Paul Kronenwetter added a comment - Is this similar to the behavior I'm seeing on http://www.cfas.org/? The entire page contents of index.xml/index.html is doubled.
        Hide
        vronk Vronk Duat added a comment -
        as can be seen it is the template for span-element.
        it could be the same problem, if there is such a big span over all of the pages content.
        it can however also be, that a similar error is some other template.
        try to find out which HTML-element gets doubled.

        Show
        vronk Vronk Duat added a comment - as can be seen it is the template for span-element. it could be the same problem, if there is such a big span over all of the pages content. it can however also be, that a similar error is some other template. try to find out which HTML-element gets doubled.
        Hide
        rgardler Ross Gardler added a comment -
        Scheduling this for 0.8-dev if the report is accurate then it should be really easy to fix - not sure why it is not on the roadmap already, perhaps we missed it in the reviews.


        I'm also increasing the severity, I'm amazed that this has not come up more frequently.

        As far as I can see all that needs to be done is to remove the second apply-templates. Can someone who is seeing this problem please confirm that everything works fine in this case. If we get that confirmation I'll make the change in SVN.

        Thanks
        Show
        rgardler Ross Gardler added a comment - Scheduling this for 0.8-dev if the report is accurate then it should be really easy to fix - not sure why it is not on the roadmap already, perhaps we missed it in the reviews. I'm also increasing the severity, I'm amazed that this has not come up more frequently. As far as I can see all that needs to be done is to remove the second apply-templates. Can someone who is seeing this problem please confirm that everything works fine in this case. If we get that confirmation I'll make the change in SVN. Thanks
        Hide
        vronk Vronk Duat added a comment -
        in my case commenting/deleting the last (unconditioned) apply-templates solved the problem.
        Show
        vronk Vronk Duat added a comment - in my case commenting/deleting the last (unconditioned) apply-templates solved the problem.
        Hide
        moshagen Sjur N. Moshagen added a comment -
        I can confirm the issue on a simple page I was playing with:

        <body>
        <h1>Below this title should be a row of iframes!</h1>
        <span style="white-space: nowrap; ">
        Some content
        </span>
        </body>

        The content of the span element was duplicated. Removing the last apply-templates, as described in the previous comment, solves the problem.

        In forrest-0.8-dev the file is named html-to-document.xsl
        Show
        moshagen Sjur N. Moshagen added a comment - I can confirm the issue on a simple page I was playing with: <body> <h1>Below this title should be a row of iframes!</h1> <span style="white-space: nowrap; "> Some content </span> </body> The content of the span element was duplicated. Removing the last apply-templates, as described in the previous comment, solves the problem. In forrest-0.8-dev the file is named html-to-document.xsl
        Hide
        kronenpj Paul Kronenwetter added a comment -
        Unfortunately my original document doesn't contain any span tags, it's still in the wretched table format. I've looked through html-to-document.xsl for any other duplicate apply:templates but I didn't see anything obvious. Maybe I need to open another issue.
        Thanks!
        Show
        kronenpj Paul Kronenwetter added a comment - Unfortunately my original document doesn't contain any span tags, it's still in the wretched table format. I've looked through html-to-document.xsl for any other duplicate apply:templates but I didn't see anything obvious. Maybe I need to open another issue. Thanks!
        Hide
        moshagen Sjur N. Moshagen added a comment -
        Fixed in revision 497876.

        That revision also contains a fix for another case of duplication:

        When /html/body/ did not contain any 'h1' elements, all of /html/body/* got duplicated, first as a raw copy, and the second time wrapped in a section.
        Show
        moshagen Sjur N. Moshagen added a comment - Fixed in revision 497876. That revision also contains a fix for another case of duplication: When /html/body/ did not contain any 'h1' elements, all of /html/body/* got duplicated, first as a raw copy, and the second time wrapped in a section.
        Hide
        kronenpj Paul Kronenwetter added a comment -
        Sjur,

          I don't think that's a completely valid fix. I'm now getting these, from Forrest-generated content:
        X [0] Board/Minutes/Board_200510.html BROKEN: The content of elements must consist of well-formed character data or markup.

        This is content generated from a .sxw (OpenOffice) file. I'm looking at html-to-document.xsl to see if I can adjust it to allow processing of H1 tags, but not require them. I have many pages that do not have such a tag.
        Show
        kronenpj Paul Kronenwetter added a comment - Sjur,   I don't think that's a completely valid fix. I'm now getting these, from Forrest-generated content: X [0] Board/Minutes/Board_200510.html BROKEN: The content of elements must consist of well-formed character data or markup. This is content generated from a .sxw (OpenOffice) file. I'm looking at html-to-document.xsl to see if I can adjust it to allow processing of H1 tags, but not require them. I have many pages that do not have such a tag.
        Hide
        kronenpj Paul Kronenwetter added a comment -
        Scratch that last comment... (Unsend! Unsend!)

        I don't know what went wrong the first few times I did it, but it's working now. I had done a 'build.sh clean' from main, then a 'build.sh', a few times in fact, and nothing changed. I'd started fiddling with html-to-document.xsl then decided against it, removed the file, then did 'svn up -r 497876' and all is well again. I've waited the 27 minutes it takes to completely build the site, and everything is fine.

        Sjur - Sorry! Your first commit seems to be a winner for me!
        Show
        kronenpj Paul Kronenwetter added a comment - Scratch that last comment... (Unsend! Unsend!) I don't know what went wrong the first few times I did it, but it's working now. I had done a 'build.sh clean' from main, then a 'build.sh', a few times in fact, and nothing changed. I'd started fiddling with html-to-document.xsl then decided against it, removed the file, then did 'svn up -r 497876' and all is well again. I've waited the 27 minutes it takes to completely build the site, and everything is fine. Sjur - Sorry! Your first commit seems to be a winner for me!

          People

          • Assignee:
            Unassigned
            Reporter:
            vronkdaut Vronk Daut
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development