Python Programming Portal
Python Programming Portal
J2EE curve
Add Site Feed
XML is useful with Java but with Python..... PDF Print E-mail
Written by Content Team   
Sunday, 28 August 2005

In this article, Uche Ogbuji writes about python and XML , the two popular and powerful technologies. Uche Ogbuji is a consultant and co-founder of Fourthought. Fourthought is a consulting firm specializing in XML solutions for enterprise knowledge management applications also develops 4Suite, the open source platform for XML middleware.


Phillip J. Eby is one of the core developers at the Open Source Applications Foundation, where the primary project is an enterprise grade groupware application written in Python (Chandler). The project includes a component architecture called Parcels, originally expressed in XML but Recently the decision was made to move from XML to Python code.

According to Uche Ogbuji, the Chandler's grown XML schema definition language was a terrible hardship on developers, he proposed to replace it with a descriptor-based Python API.

While migrating to Python it's easy to forget to reassess the value of XML. If you define configuration and scripting for an application in a python and use the same language to express the script, the instructions in the script files can be directly executed in the context of the host process, which provides a tremendous amount of flexibility. Although this does not mean that there is no need for a XML..

Using Python itself for scripting gives you the full power of Python, and the script author is not restricted to simple key-value style parameters Uche Ogbuji continues, if you don't need to invent a new syntax that the Python developer needs to learn, you shouldn't do so, becausedoing so is erecting an unnecessary hurdle. This should be simple common sense rather than an exhibit in the case against XML.

XML Vs Python

  • XML is often not the best choice for configuration and scripting in Python applications.
  • XML is no more a good code format than Python is a good document format.
  • Compared to Python code, XML is a boat anchor, a ball and chain.
  • In Python, XML is something you use for inter-operability and not your core functionality, because you simply don't need it.
  • In Java, avoiding coding is an advantage because coding means recompiling. But in Python, more often than not, code is easier to write than XML.
  • Python can process code much, much faster than your code can process XML.
  • you have to write the XML processing code, whereas Python itself is already written for you.

One thing is sure, XML might not be so useful with thepython but certainly useful with other languages.

Reference:
>> Should Python and XML Coexist?

Comments

You must javascript enabled to use this form


Add Python Site Feed
Latest
Popular
Go to top of page  Home | Content | Resources | Contact Us | Blogs |

Copyright 2004 Rightrix Solutions. All rights reserved. All product names are trademarks of their respective companies.
Views expressed at PythonThreads.com reflect the views of the authors alone, and do not necessarily reflect those of PythonThreads.com.

Terms of Use          Privacy Policy
PythonThreads.com - Python Programming Language Portal