Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Text Editing&Processing > Markup

    generateDS.py 2.7b

    Download button

    No screenshots available
    Downloads: 1,097  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.4/5)
    20 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Dave Kuhlman | More programs
    MIT/X Consortium Lic... / FREE
    December 12th, 2011, 17:37 GMT [view history]
    ROOT / Text Editing&Processing / Markup

     Read user reviews (0)  Refer to a friend  Subscribe

    generateDS.py description

    generateDS.py generates Python data structures (for example, class definitions) from an XML Schema document.

    generateDS.py generates Python data structures (for example, class definitions) from an XML Schema document. These data structures represent the elements in an XML document described by the XML Schema.

    It also generates parsers that load an XML document into those data structures. In addition, a separate file containing subclasses (stubs) is optionally generated. The user can add methods to the subclasses in order to process the contents of an XML document.

    The generated Python code contains:
    � A class definition for each element defined in the XML Schema document.
    � A main and driver function that can be used to test the generated code.
    � A parser that will read an XML document which satisfies the XML Schema from which the parser was generated. The parser creates and populates a tree structure of instances of the generated Python classes.
    � Methods in each class to export the instance back out to XML (method export) and to export the instance to a literal representing the Python data structure (method exportLiteral).

    The generated classes contain the following:
    � A constructor method (__init__), with member variable initializers.
    � Methods with names 'getX' and 'setX' for each member variable 'X' or, if the member variable is defined with maxOccurs="unbounded", methods with names 'getX', 'setX', 'addX', and 'insertX'.
    � A "build" method that can be used to populate an instance of the class from a node in a minidom tree.
    � An "export" method that will write the instance (and any nested sub-instances) to a file object as XML text.
    � An "exportLiteral" method that will write the instance (and any nested sub-instances) to a file object as Python literals (text).

    The generated subclass file contains one (sub-)class definition for each data representation class. If the subclass file is used, then the parser creates instances of the subclasses (instead of creating instances of the superclasses). This enables the user to extend the subclasses with "tree walk" methods, for example, that process the contents of the XML file. The user can also generate and extend multiple subclass files which use a single, common superclass file, thus implementing a number of different processes on the same XML document type.

    This document explains (1) how to use generateDS.py; (2) how to use the Python code and data structures that it generates; and (3) how to modify the generated code for special purposes.


    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Fix for generation of recusively defined simpleTypes, e.g. a simpleType defined as a restriction of another simpleType. (see fix_simpletype comment in generateDS.py)
    · Added version number to generated class files.
    · Fixes to/for process_includes.py -- DirPath/DIRPATH now initialized correctly and fixed failure to initialize a local variable.

      


    TAGS:

    generates Python data | Python data structures | class definitions | generateDS | generates | Python

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM