Commit ecd91abc authored by Nicolas Delaby's avatar Nicolas Delaby

disbale xml_declaration by default

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25161 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1919d5ec
......@@ -1224,11 +1224,11 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn,
return error_list
security.declareProtected(Permissions.AccessContentsInformation, 'asXML')
def asXML(self):
def asXML(self, omit_xml_declaration=True):
"""
Generate an xml text corresponding to the content of this object
"""
return Folder_asXML(self)
return Folder_asXML(self, omit_xml_declaration=omit_xml_declaration)
# Optimized Menu System
security.declarePublic('getVisibleAllowedContentTypeList')
......
......@@ -152,10 +152,11 @@ def Base_asXML(object, root=None):
return etree.tostring(root, encoding='utf-8',
xml_declaration=True, pretty_print=True)
def Folder_asXML(object):
def Folder_asXML(object, omit_xml_declaration=True):
"""
Generate an xml text corresponding to the content of this object
"""
xml_declaration = not omit_xml_declaration
from Products.ERP5Type.Base import Base
self = object
root = Element('erp5')
......@@ -170,4 +171,4 @@ def Folder_asXML(object):
Base_asXML(o, root=root_node)
return etree.tostring(root, encoding='utf-8',
xml_declaration=True, pretty_print=True)
xml_declaration=xml_declaration, pretty_print=True)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment