Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-4253

Document contents should be put in CDATA section in XML export

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • None
    • 2.0 RC2
    • {Unused} Packaging
    • None
    • patch
    • Trivial

    Description

      I believe that the document contents should be put in a CDATA section, as it may contain xml-markup. Otherwise it is problematic to manage the documents with external tools. At least the XML::DOM library for Perl mess up the contents.

      Here is a patch:

      Index: xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
      ===================================================================
      --- xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java	(revision 21701)
      +++ xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java	(arbetskopia)
      @@ -2604,7 +2604,7 @@
               // String newcontent = filter.process(getContent());
               // String newcontent = encodedXMLStringAsUTF8(getContent());
               String newcontent = this.content;
      -        el.addText(newcontent);
      +        el.addCDATA(newcontent);
               docel.add(el);
       
               if (bWithRendering) {
      

      Attachments

        Activity

          People

            aj Andreas Jonsson
            aj Andreas Jonsson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: