[Erp5-report] r38944 kazuhiko - /erp5/trunk/products/PortalTransforms/transforms/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 7 10:04:35 CEST 2010


Author: kazuhiko
Date: Thu Oct  7 10:04:34 2010
New Revision: 38944

URL: http://svn.erp5.org?rev=38944&view=rev
Log:
add a simple transform that extract all texts in XML.

Added:
    erp5/trunk/products/PortalTransforms/transforms/xml_to_text.py
Modified:
    erp5/trunk/products/PortalTransforms/transforms/__init__.py

Modified: erp5/trunk/products/PortalTransforms/transforms/__init__.py
URL: http://svn.erp5.org/erp5/trunk/products/PortalTransforms/transforms/__init__.py?rev=38944&r1=38943&r2=38944&view=diff
==============================================================================
--- erp5/trunk/products/PortalTransforms/transforms/__init__.py [utf8] (original)
+++ erp5/trunk/products/PortalTransforms/transforms/__init__.py [utf8] Thu Oct  7 10:04:34 2010
@@ -22,6 +22,7 @@ modules = [
     'safe_html',      # extract <body> and remove potentially harmful tags
     'html_body',      # extract only the contents of the <body> tag
     'html_to_text',   # re based transform
+    'xml_to_text',    # re based transform
     'text_to_html',   # wrap text in a verbatim env
     'text_pre_to_html', # wrap text into a pre
     'png_to_text',

Added: erp5/trunk/products/PortalTransforms/transforms/xml_to_text.py
URL: http://svn.erp5.org/erp5/trunk/products/PortalTransforms/transforms/xml_to_text.py?rev=38944&view=auto
==============================================================================
--- erp5/trunk/products/PortalTransforms/transforms/xml_to_text.py (added)
+++ erp5/trunk/products/PortalTransforms/transforms/xml_to_text.py [utf8] Thu Oct  7 10:04:34 2010
@@ -0,0 +1,10 @@
+from Products.PortalTransforms.libtransforms.retransform import retransform
+
+class xml_to_text(retransform):
+    inputs  = ('text/xml', 'application/xml')
+    output = 'text/plain'
+
+def register():
+    return xml_to_text("xml_to_text",
+                       ('<[^>]*>', ' '),
+                       )




More information about the Erp5-report mailing list