Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-443

Add support for empty prolog when parsing XHTML 1.0 content

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Fix
    • Major
    • None
    • 7.4
    • None
    • N/A
    • N/A

    Description

      Right now the XHTML 1.0 Renderer doesn't generate any prolog and thus the following fails:

      {{velocity}}
      #set ($xdom = $services.rendering.parse('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head></head><body><p>a</p><p>b</p><p>c</p><div class="wikimodel-emptyline"></div></body></html>', 'xhtml/1.0'))
      #set ($xhtml = $services.rendering.render($xdom, 'xhtml/1.0'))
      $services.rendering.parse($xhtml, 'xhtml/1.0')
      {{/velocity}}
      

      Note that this issue is causing a bug when using XHTML 1.0 in the WYSIWYG editor, see XWIKI-13278.

      This issue is about supporting content with no prolog to make it symmetric with the XHTML Renderer. Note that this is a backward-compatible solution. See http://markmail.org/message/6z4f7aaujbeirleb

      Also note that this works only if the defined XML is encoded with UTF-8.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: