zoukankan      html  css  js  c++  java
  • [eZ publish] & in xml files

    When I use this extension of ezXML Export, I found that when the content contains &, the xml can be exported but can't open.
    Then i Found that the type of the attribute is a text line, and in the code os ezxmlupload, it just output the content, so i change the code of ezxmlupload.

    extension/ezxmlexport/classes/datatypes/ezstring/ezstringxmlexport.php
    Line 49:
    Change from

    return $this->contentObjectAttribute->content();

    To

    return "<![CDATA[\n"
    .$this->contentObjectAttribute->content()
    . "]]>\n";

    also, you can change another file to void this problem.


    extension/ezxmlexport/classes/datatypes/eztext/eztextxmlexport.php
    Line 33:
    Change form

    return $this->contentObjectAttribute->content();
    To

    return
    "<![CDATA[\n"
    .$this->contentObjectAttribute->content()
    . "]]>\n";

    In fact that, we just want to add "<![CDATA["  and "]]>" to the start and the end of the content, this method not only takes effect in ezXML Export, but it is a common method to solve the & in xml files.

    Have fun! :)

  • 相关阅读:
    JavaScript基础语法及字符串相关方法(1)
    matplotlib实现三维柱状图
    前端入门CSS(3)
    博客页面练习
    前端入门CSS(2)
    前端入门CSS(1)
    前端入门html(表单)
    Longest Palindromic Substring
    Wildcard Matching
    Spiral Matrix II
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/1779062.html
Copyright © 2011-2022 走看看