Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-200

New XHTML serializer based on cocoon's XHTMLSerializer which doesn't collapse most of the tags

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1.3, 2.0.0 M3
    • 1.0.2, 1.1.2
    • None
    • None

      modify HTMLSerializer to

      • not collapse <textarea>
      • insert comment in empty <div>, <h1-6>, <a>, <strong>, <b>, <u>, <em>, <i>... (list easly extendable)

          [RUNTIME-200] New XHTML serializer based on cocoon's XHTMLSerializer which doesn't collapse most of the tags

          Integrated with modifications into trunk and 1.1 branch.
          Allowed namespaces are:

          But this can be configureable.

          Sébastien Launay (Inactive) added a comment - Integrated with modifications into trunk and 1.1 branch. Allowed namespaces are: empty namespace http://www.w3.org/XML/1998/namespace http://www.w3.org/1999/xhtml http://www.w3.org/2000/svg http://www.w3.org/1998/Math/MathML But this can be configureable.

          only let the following namespace go through

          • {}
          • {http://www.w3.org/1999/xhtml}
          • {http://www.w3.org/2000/svg}
          • {http://www.w3.org/1998/Math/MathML}

          list to put in the configuration of the component ? component is often overloaded... will be awfull to do
          => put this list hardcoded and allow overloading

          Raphaël Franchet added a comment - only let the following namespace go through {} {http://www.w3.org/1999/xhtml} {http://www.w3.org/2000/svg} {http://www.w3.org/1998/Math/MathML} list to put in the configuration of the component ? component is often overloaded... will be awfull to do => put this list hardcoded and allow overloading

          Joined newest jars (compiled by Cedric Damioli for coherence with other cocoon jars).

          Nicolas Gavalda (Inactive) added a comment - Joined newest jars (compiled by Cedric Damioli for coherence with other cocoon jars).

          I reopened this issue as it has not been integrated yet on both trunk and 1.1 branch.

          Sébastien Launay (Inactive) added a comment - I reopened this issue as it has not been integrated yet on both trunk and 1.1 branch.

          Joined the HEAD patch file (contains the XHTMLSerializer and the release note) and the two dependencies.
          The serializers block is to be included in the kernel libs, the charsets in the application template.

          Nicolas Gavalda (Inactive) added a comment - Joined the HEAD patch file (contains the XHTMLSerializer and the release note) and the two dependencies. The serializers block is to be included in the kernel libs, the charsets in the application template.

          Added a new XHTML serializer, based on cocoon's XHTMLSerializer, which doesn't collapse most of the tags.
          New jars were added to the kernel and to the application template, so make sure to add them to your project when upgrading.

          Nicolas Gavalda (Inactive) added a comment - Added a new XHTML serializer, based on cocoon's XHTMLSerializer, which doesn't collapse most of the tags. New jars were added to the kernel and to the application template, so make sure to add them to your project when upgrading.

          Temporary workaround : created a new Serializer based on cocoon's XMLSerializer, specifying a new content handler which inherits from xalan's ToXMLStream, never collapsing empty elements.

          Generating with this serializer and specifying it as the default serializer in the site workspace sitemap seems to work as expected.
          However, setting is as the html serializer in the kernel's sitemap (used all over the CMS application) instead of cocoon's HTMLSerializer generates some unexpected effects : some characters seem to be output escaped.

          Nicolas Gavalda (Inactive) added a comment - Temporary workaround : created a new Serializer based on cocoon's XMLSerializer, specifying a new content handler which inherits from xalan's ToXMLStream, never collapsing empty elements. Generating with this serializer and specifying it as the default serializer in the site workspace sitemap seems to work as expected. However, setting is as the html serializer in the kernel's sitemap (used all over the CMS application) instead of cocoon's HTMLSerializer generates some unexpected effects : some characters seem to be output escaped.

          I find that cocoon has a serializer block with a XHTMLSerializer but it does supports only textarea, script, style and meta.

          I have just submitted a patch with a new xalan property for disabling empty element collapsing:
          https://issues.apache.org/jira/browse/XALANJ-1906

          Sébastien Launay (Inactive) added a comment - I find that cocoon has a serializer block with a XHTMLSerializer but it does supports only textarea, script, style and meta. I have just submitted a patch with a new xalan property for disabling empty element collapsing: https://issues.apache.org/jira/browse/XALANJ-1906

          Xalan collapse textarea whatever the transformation output method use.
          Adding a comment is simply rendered as text in the textarea.

          There two solutions :

          • use a invisible space caracters like "Zero Width No-Break Space" (only in unicode) ;
          • wrap the final OutputStream in a Writer for replacing "<textarea.?/>" with "<textarea></textarea>".

          For weird spaces see:
          http://en.wikipedia.org/wiki/Space_(punctuation)

          Sébastien Launay (Inactive) added a comment - Xalan collapse textarea whatever the transformation output method use. Adding a comment is simply rendered as text in the textarea. There two solutions : use a invisible space caracters like "Zero Width No-Break Space" (only in unicode) ; wrap the final OutputStream in a Writer for replacing "<textarea.?/>" with "<textarea></textarea>" . For weird spaces see: http://en.wikipedia.org/wiki/Space_(punctuation )

            yabon Sébastien Launay (Inactive)
            raphael Raphaël Franchet
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: