Forrest
  1. Forrest
  2. FOR-241

character entities (e.g. ampersand) are expanded again for href or src attributes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.6, 0.7, 0.8, 0.9
    • Fix Version/s: 0.9
    • Component/s: Core operations
    • Labels:
      None

      Description

      If I have a url like this inside the XML source:

      http://sourceforge.net/sflogo.php?group_id=comics-grabber&type=1

      validate-xdocs fails because it wants the literal & to be typed out as
      & instead. So I correct it to become:

      http://sourceforge.net/sflogo.php?group_id=comics-grabber&type=1

      However, the generated HTML has the entity resolution UNDONE!:

      http://sourceforge.net/sflogo.php?group_id=comics-grabber&type=1

      This HTML fails validation as 4.01 transitional.

      David Crossley adds:
      There is a demonstration of the problem in the document
      src/documentation/content/xdocs/docs/dreams.xml
      The ampersand in the link element text is properly handled but
      the ampersand in the link href attribute is not.

        Activity

        Hide
        David Crossley added a comment -
        I have done some investigation. The issue only happens on the link/@href and a/@href and img/@src attributes. Other attributes are okay, e.g. link/@title and img/@alt

        In 0.7-dev, request http://localhost:8888/body-dreams.html ... View-source shows that the a/@href attributes have been mangled. Now in the main/webapp/sitemap.xmap go to the <map:resource name="skinit"> at line 208. Replace the html serializer with an xml serializer. View-source for body-dreams.html shows that the entities are intact. So it is the html serializer on the internal pipeline that "fixes" the href attributes.

        Using today's cocoon-trunk and their "Hello world" sample, adding an <a> element, shows that there is no such problem.
        Show
        David Crossley added a comment - I have done some investigation. The issue only happens on the link/@href and a/@href and img/@src attributes. Other attributes are okay, e.g. link/@title and img/@alt In 0.7-dev, request http://localhost:8888/body-dreams.html ... View-source shows that the a/@href attributes have been mangled. Now in the main/webapp/sitemap.xmap go to the <map:resource name="skinit"> at line 208. Replace the html serializer with an xml serializer. View-source for body-dreams.html shows that the entities are intact. So it is the html serializer on the internal pipeline that "fixes" the href attributes. Using today's cocoon-trunk and their "Hello world" sample, adding an <a> element, shows that there is no such problem.
        Hide
        David Crossley added a comment -
        Changed the Issue Title to be a bit more explicit.
        Show
        David Crossley added a comment - Changed the Issue Title to be a bit more explicit.
        Hide
        Thorsten Scherler added a comment -
        Would an cocoon update fix this issue?
        Show
        Thorsten Scherler added a comment - Would an cocoon update fix this issue?
        Hide
        Tim Williams added a comment -
        Pushing off...
        Show
        Tim Williams added a comment - Pushing off...
        Hide
        David Crossley added a comment -
        I did some tests, and this seems to be fixed. Probably by our subsequent Cocoon upgrade.
        Show
        David Crossley added a comment - I did some tests, and this seems to be fixed. Probably by our subsequent Cocoon upgrade.

          People

          • Assignee:
            Unassigned
            Reporter:
            Diwaker Gupta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development