Author: jmorliaguet
Date: Fri Apr 14 14:57:01 2006
New Revision: 2843

Modified:
   cpsskins/branches/jmo-perspectives/setup/utils.py
Log:

- more human-readable XML



Modified: cpsskins/branches/jmo-perspectives/setup/utils.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/setup/utils.py   (original)
+++ cpsskins/branches/jmo-perspectives/setup/utils.py   Fri Apr 14 14:57:01 2006
@@ -96,21 +96,22 @@
         properties = []
         schema = IType(context).getResourceType()
 
-        content = u''
+        content = []
         for name in getFieldNamesInOrder(schema):
-            content += u'<property name=%(name)s value="%(value)s" />' % {
+            content.append(
+                u'<%(name)s value="%(value)s" />' % {
                 'name': name,
                 'value': serialize(getattr(context, name)),
-                }
+                })
 
         return u"""<?xml version="1.0"?>
-        <%(name)s uri="%(uri)s">
-          %(content)s
-        </%(name)s>
+<%(name)s uri="%(uri)s">
+%(content)s
+</%(name)s>
         """ % {
             'name': schema.getTaggedValue(u'name'),
             'uri': IIdentifiable(context).getURI(),
-            'content': content,
+            'content': u'\n'.join(content),
             }
 
 class ObjectImporter(object):
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to