• Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 168 for Xml/xsd-fu/trunk/xsd-fu

Show
Ignore:
Timestamp:
04/11/08 13:59:39 (8 months ago)
Author:
callan
Message:

generateDS bug fixes:

  • Nested simpleType definitions now handled universally (booleans are insufficient)
  • New style classes throughout

xsd-fu additions:

  • Basic support for OME XML 2003 model (some hacks required)
  • Full support for OME XML 2008 model
  • XML Schema namespace definition support with "-n" command line argument
  • More configuration of certain overrides in xsd-fu mapping now available
Files:
1 modified

  • Xml/xsd-fu/trunk/xsd-fu (modified) (6 diffs)

Legend:

Unmodified
Added
Removed
  • Xml/xsd-fu/trunk/xsd-fu

    r151 r168  
    4646        cmd = sys.argv[0] 
    4747        print """%s 
    48 Usage: %s [-p package] -o <output_dir> <path/to/ome.xsd> 
     48Usage: %s [-n xsd_namespace] [-p package] -o <output_dir> <path/to/ome.xsd> 
    4949Generates Java classes from an OME XML Schema definition. 
    5050 
     51Default package: "%s" 
     52Default namespace: "%s" 
     53 
    5154Examples: 
    52   %s -p ome.xml -o ome/xml schemas/ome.xsd 
     55  %s -n 'xs:' -p ome.xml -o ome/xml schemas/ome.xsd 
    5356 
    54 Report bugs to Chris Allan <callan@blackcat.ca>""" % (error, cmd, cmd) 
     57Report bugs to Chris Allan <callan@blackcat.ca>""" % \ 
     58        (error, cmd, DEFAULT_PACKAGE, NAMESPACE, cmd) 
    5559        sys.exit(2) 
    5660 
    … …  
    6165        """ 
    6266        try: 
    63                 options, args = getopt(sys.argv[1:], "o:p:") 
     67                options, args = getopt(sys.argv[1:], "o:p:n:") 
    6468        except GetoptError, (msg, opt): 
    6569                usage(msg) 
    … …  
    7074        outputDirectory = None 
    7175        package = DEFAULT_PACKAGE 
     76        namespace = DEFAULT_NAMESPACE 
    7277        for option, argument in options: 
    7378                if option == "-o": 
    … …  
    7580                if option == "-p": 
    7681                        package = argument 
     82                if option == "-n": 
     83                        namespace = argument 
    7784        if outputDirectory is None: 
    7885                usage("Output directory must be specified!") 
    … …  
    8188                sys.exit(1) 
    8289 
    83         model = parseXmlSchema(args[0]) 
     90        model = parseXmlSchema(args[0], namespace) 
    8491        fu = TemplateInfo(outputDirectory, package) 
    8592        template = NewTextTemplate(open(CLASS_TEMPLATE).read()) 
    … …  
    97104        outputDirectory = None 
    98105        package = DEFAULT_PACKAGE 
     106        namespace = "xs:" 
    99107 
    100         model = parseXmlSchema("tmp/ome.xsd") 
     108        model = parseXmlSchema("tmp/schemas/2003/ome.xsd", namespace) 
    101109        fu = TemplateInfo(outputDirectory, package) 
    102110        template = NewTextTemplate(open(CLASS_TEMPLATE).read()) 
    103111        for obj in model.objects.values(): 
    104                 if obj.name == "Laser": 
     112                if obj.name == "Image": 
    105113                        print " +-- %s(%s)" % (obj.name, obj.base) 
    106114                        for prop in obj.properties.values(): 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/