Cocoon
  1. Cocoon
  2. COCOON-1531

problem with htmlserializer (strange character in output )

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.7
    • Fix Version/s: 2.1.10
    • Component/s: - Components: Sitemap
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other

      Description

      Using the latest Cocoon (2.1.7) I have a problem with serialize type="html".
       
        <map:read src="index.html"/>
       
      works fine.
       
      But using the following (index.html is well balanced XML):
       
        <map:generate src="index.html"/>
        <map:serialize type="html"/>
       
      adds a greater than character '>' in the output:
       
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
      >
      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/b"
      xmlns:s="http://www.backbase.com/s">
       
      It only happens if the original document also has a DOCTYPE definition (will be
      removed by Cocoon):
       
      <!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:b="http://www.backbase.com/b"
      xmlns:s="http://www.backbase.com/s">

      Note that it only happens with org.apache.cocoon.serialization.HTMLSerializer;
      not with org.apache.cocoon.serialization.XMLSerializer.
      It doesn't matter if you configure with or without doctype, encoding etc.
       
          <map:serializer logger="sitemap.serializer.html" mime-type="text/html"
      name="html" pool-grow="4" pool-max="32" pool-min="4"
      src="org.apache.cocoon.serialization.HTMLSerializer">
            <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
            <doctype-system>http://www.w3.org/TR/html4/loose.dtd&lt;/doctype-system>
            <encoding>UTF-8</encoding>
          </map:serializer>

        Activity

        kees_broenink created issue -
        Jeff Turner made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 35387 12324840
        Pier Fumagalli made changes -
        Workflow jira [ 12341275 ] Cocoon Workflow [ 12341463 ]
        Antonio Gallardo made changes -
        Assignee Cocoon Developers Team [ cocoon ] Antonio Gallardo [ antonio ]
        Hide
        Antonio Gallardo added a comment -
        I think this issue is already fixed. I wrote a test case: http://cocoon.zones.apache.org/demos/21branch/samples/test/serializer-html/explain-test.html

        The server is updated 2 time per day. If the page fails, please try later.

        Once I wrote the testcase for cocoon 2.2. I plan to close this issue.
        Show
        Antonio Gallardo added a comment - I think this issue is already fixed. I wrote a test case: http://cocoon.zones.apache.org/demos/21branch/samples/test/serializer-html/explain-test.html The server is updated 2 time per day. If the page fails, please try later. Once I wrote the testcase for cocoon 2.2. I plan to close this issue.
        Antonio Gallardo made changes -
        Status Open [ 1 ] On Hold [ 10000 ]
        Hide
        Jörg Heinicke added a comment -
        The issue itself was fixed by upgrading XML libs IIRC.

        Antonio, it might be good to have a "real" test using HtmlUnit if you are still working on it ;)
        Show
        Jörg Heinicke added a comment - The issue itself was fixed by upgrading XML libs IIRC. Antonio, it might be good to have a "real" test using HtmlUnit if you are still working on it ;)
        Jörg Heinicke made changes -
        Resolution Fixed [ 1 ]
        Status On Hold [ 10000 ] Closed [ 6 ]
        Fix Version/s 2.1.10 [ 12310931 ]

          People

          • Assignee:
            Antonio Gallardo
            Reporter:
            kees_broenink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development