suncloud Nice, France
T: 14.0°C  H: 47%  P: 1017 hPa
Wind: 6.3 m/s from North North West
Few clouds
suncloud La Tontouta Nlle-Caledonie , New Caledonia
T: 21.0°C  H: 64%  P: 1016 hPa
Wind: 6.3 m/s from South East
Few clouds

LibreLogiciel dot COM

Google
 
Web librelogiciel.com
Presentation
Software
Technical Support
Services
Contact
Links

 [<<< [Presentation] [News] [Download]

JAXML :

  • JAXML is a Python module which makes the automated generation of XML, XHTML or HTML documents easy.
  • JAXML is part of the official Debian GNU/Linux distribution.
  • If we believe our logs, it seems to be used internally by companies and universities worldwide : Boeing , Philips , Sanofi , and many others... Please tell us if you use it.
  • Documents generated with JAXML are still easily human readable.
  • Here are two samples of automated XML document generation, the first one with the classical file objects, the second one using JAXML :
          # --- Classical Version
          fp = open("sample.xml", "w")
          fp.write('<?xml version="1.0" encoding="iso-8859-1"?>\n')
          fp.write('<sometag someattr="1">\n')
          fp.write('    <anothertag jaxml="Nice">\n')
          fp.write('        <thirdone>Yo</thirdone>\n')
          fp.write('    </anothertag>\n')
          fp.write('</sometag>\n')
          fp.close()
    
          # an equivalent version using JAXML
          import jaxml
          doc = jaxml.XML_document()
          doc.sometag(someattr=1).anothertag(jaxml="Nice")
          doc.thirdone("Yo")
          doc._output("sample.xml")
    
          # Both produce the same output 
          <?xml version="1.0" encoding="iso-8859-1"?>
          <sometag someattr="1">
              <anothertag jaxml="Nice">
                  <thirdone>Yo</thirdone>
              </anothertag>
          </sometag>
    
        As you may see above, JAXML takes care of the most annoying things for you :
    
          * closing tags
    
          * indentation to maintain human readability
    
        But more than that JAXML gives you some interesting possibilities :
    
          * full support of xml namespaces since version 3.0
    
          * a base class which takes care of all sorts of tagged documents
    
          * add or multiply documents
    
          * output to file objects, strings, file names
    
          * special constructs or shortcuts dedicated to HTML or CGI output
    
          * Two different templating facilities
    
          * And many more...
    
  • To learn more, just Download it !

© 2000-2014 by Jerome Alet
Email : webmaster@librelogiciel.com