From 9c1a8467c851590a41891c8d8c2ec49964060fbf Mon Sep 17 00:00:00 2001 From: Dave Kuhlman <dkuhlman@davekuhlman.org> Date: Thu, 1 Jun 2017 09:04:09 -0700 Subject: [PATCH] Prior to release of v. 2.27a --HG-- branch : oneper --- README.rst | 34 ++++ django/gends_extract_simple_types.py | 11 +- django/gends_run_gen_django.py | 18 +- generateDS.html | 192 ++++++++++++++---- generateDS.py | 55 ++++- generateDS.txt | 130 +++++++++++- generateds_gui_notes.html | 6 +- generateds_gui_notes.txt | 2 +- gui/generateds_gui.py | 2 +- librarytemplate_howto.html | 6 +- librarytemplate_howto.txt | 2 +- process_includes.py | 25 +-- setup.py | 2 +- tests/OnePer/oneperType00_2One.py | 31 ++- tests/OnePer/oneperType01_2One.py | 34 +++- tests/OnePer/oneperType02_2One.py | 34 +++- tests/OnePer/oneperType03_2One.py | 34 +++- tests/abstract_type1_sup.py | 40 +++- tests/annotations1_sup.py | 37 +++- tests/anonymous_type1_sup.py | 40 +++- tests/anysimpletype1_sup.py | 34 +++- tests/anywildcard1_sup.py | 46 ++++- tests/attr_groups1_sup.py | 31 ++- tests/catalogtest1_sup.py | 28 ++- tests/cdata1_sup.py | 34 +++- tests/cleanupname1_sup.py | 46 ++++- tests/defaults_cases1_sup.py | 37 +++- tests/defaults_coverage1_sup.py | 37 +++- tests/extensions1_sup.py | 64 +++++- tests/ipo1_sup.py | 49 ++++- tests/ipo2_sup.py | 49 ++++- tests/mapcleanname1_sup.py | 49 ++++- tests/nested_def1_sup.py | 43 +++- tests/out1_sup.py | 64 +++++- tests/people_procincl1_sup.py | 76 ++++++- tests/prefix_classname1_sup.py | 64 +++++- tests/recursive_simpletype1_sup.py | 31 ++- tests/reference_simpletype1_sup.py | 31 ++- tests/rem_dup_elems1_sup.py | 34 +++- tests/simplecontent_restriction1_sup.py | 37 +++- tests/simpletype_memberspecs1_sup.py | 34 +++- tests/simpletypes_other1_sup.py | 34 +++- tests/to_etree1_sup.py | 28 ++- tests/validate_simpletypes1_sup.py | 40 +++- tests/validate_simpletypes1_warnings.txt | 60 +++--- tests/validate_simpletypes2_sup.py | 40 +++- tutorial/generateds_tutorial.html | 6 +- tutorial/generateds_tutorial.txt | 2 +- tutorial/generateds_tutorial.zip | Bin 48768 -> 48765 bytes updateversion.py | 7 +- utils/README.txt | 110 ++++++++++ utils/batch_generate.py | 243 +++++++++++++++++++++++ utils/collect_schema_locations.py | 155 +++++++++++++++ utils/show_schema_hierarchy.py | 138 +++++++++++++ 54 files changed, 2362 insertions(+), 154 deletions(-) create mode 100644 utils/README.txt create mode 100755 utils/batch_generate.py create mode 100755 utils/collect_schema_locations.py create mode 100755 utils/show_schema_hierarchy.py diff --git a/README.rst b/README.rst index f352ecf..17b8110 100644 --- a/README.rst +++ b/README.rst @@ -141,6 +141,40 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Change history -------------- +Version 2.27a (06/01/2017) + +- Fixed bug in gends_extract_simple_types.py that caused an + exception when the simpleType name has a namespace prefix. + Thanks to Rémy Gibault for reporting this. +- Added two utilities that can be used to replace the capability + invoked by the --one-file-per-xsd command line option. + utils/collect_schema_locations.py can be used to collect and write + out the top level schema locations. batch_generate.py can be used + to (read the output from collect_schema_locations.py and generate + modules. Use --help to obtain more information from each of + these. For instructions on this, see the docs and also the README + in the utils/ subdirectory. +- Various fixes for the generation of namespace prefix definitions + when the generated export functions are called. Thanks to Eugene + Petkevich for reporting and working with me on this. +- Added command line option --no-namespace-defs to force export + functions to not added namespace prefix defintions. +- Added ability for generated modules to import a module + (generatedsnamespaces.py) containing a dictionary + (GenerateDSNamespaceDefs) that maps element type names to the + namespace prefix definitions (or any XML attributes, actually) + that are to be added to specific elements during export. See the + docs and also notes near where generatedsnamespaces.py is imported + in a generated module. +- Fixed an error in gends_run_gen_django.py which caused it to fail + when generateDS.py produced a warning message. Thanks to Rémy + Gibault for catching and reporting this. +- Added a utility to help with analyzing complex schemas. + utils/show_schema_hierarchy.py can by used to show an indented + hierarchy of schemas that are pulled in by xs:include and + xs:import elements. Type `utils/show_schema_hierarchy.py --help` + for more info. Also see the docs. + Version 2.26a (05/09/2017) - Added command line options --no-collect-includes and diff --git a/django/gends_extract_simple_types.py b/django/gends_extract_simple_types.py index 07865cb..a210580 100755 --- a/django/gends_extract_simple_types.py +++ b/django/gends_extract_simple_types.py @@ -274,9 +274,16 @@ def resolve_1_simple_type(descriptor, resolved, unresolved): resolved[descriptor.name] = descriptor return type_obj else: - #import pdb; pdb.set_trace() + type_name = descriptor.type_name + if type_name not in unresolved: + # If we can't find it, try after stripping off namespace prefix. + type_name = type_name.split(':')[-1] + if type_name not in unresolved: + raise XmlSchemaError( + "Can't find simple type (%s) in unresolved types." % ( + type_name)) type_obj = resolve_1_simple_type( - unresolved[descriptor.type_name], + unresolved[type_name], resolved, unresolved) descriptor.type_obj = type_obj resolved[descriptor.name] = descriptor diff --git a/django/gends_run_gen_django.py b/django/gends_run_gen_django.py index 2786368..51ed73f 100755 --- a/django/gends_run_gen_django.py +++ b/django/gends_run_gen_django.py @@ -32,6 +32,7 @@ import sys import getopt import os from subprocess import Popen, PIPE +from glob import glob # @@ -61,7 +62,16 @@ def generate(options, schema_file_name): admin_file_name = 'admin.py' dbg_msg(options, 'schema_name_stem: %s\n' % (schema_name_stem, )) dbg_msg(options, 'bindings_file_name: %s\n' % (bindings_file_name, )) - if not options['force']: + if options['force']: + file_names = ( + glob(bindings_file_name) + + glob('%s.pyc' % bindings_file_stem) + + glob('__pycache__/%s.*.pyc' % bindings_file_stem) + ) + for file_name in file_names: + dbg_msg(options, 'removing: %s\n' % file_name) + os.remove(file_name) + else: flag1 = exists(bindings_file_name) flag2 = exists(model_file_name) flag3 = exists(form_file_name) @@ -101,14 +111,12 @@ def run_cmd(options, args): content2 = process.stdout.read() if content1: sys.stderr.write('*** error ***\n') - sys.stderr.write(content1) + sys.stderr.write(content1.decode('utf-8')) sys.stderr.write('*** error ***\n') - return False if content2: dbg_msg(options, '*** message ***\n') - dbg_msg(options, content2) + dbg_msg(options, content2.decode('utf-8')) dbg_msg(options, '*** message ***\n') - return True return True diff --git a/generateDS.html b/generateDS.html index cd00184..1469649 100644 --- a/generateDS.html +++ b/generateDS.html @@ -220,7 +220,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.26a</td> +<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.27a</td> </tr> </tbody> </table> @@ -229,7 +229,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">May 09, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">June 01, 2017</td> </tr> </tbody> </table> @@ -357,35 +357,40 @@ to process the contents of an XML document.</td> <li><a class="reference internal" href="#id4" id="id78">12.7 Mixed content</a></li> <li><a class="reference internal" href="#id6" id="id79">12.8 anyAttribute</a></li> <li><a class="reference internal" href="#user-methods" id="id80">12.9 User Methods</a></li> -<li><a class="reference internal" href="#overridable-methods" id="id81">12.10 Overridable methods</a></li> +<li><a class="reference internal" href="#overridable-methods-generatedssuper-py" id="id81">12.10 Overridable methods -- generatedssuper.py</a></li> <li><a class="reference internal" href="#the-element-name-to-class-name-dictionary" id="id82">12.11 The element name to class name dictionary</a></li> +<li><a class="reference internal" href="#adding-custom-exported-attributes-and-namespace-prefix-definitions" id="id83">12.12 Adding custom exported attributes and namespace prefix definitions</a></li> </ul> </li> -<li><a class="reference internal" href="#one-per-generating-separate-files-from-imported-included-schemas" id="id83">13 "One Per" -- generating separate files from imported/included schemas</a></li> -<li><a class="reference internal" href="#how-to-modify-the-generated-code" id="id84">14 How to modify the generated code</a><ul class="auto-toc"> -<li><a class="reference internal" href="#adding-features-to-class-definitions" id="id85">14.1 Adding features to class definitions</a></li> +<li><a class="reference internal" href="#one-per-generating-separate-files-from-imported-included-schemas" id="id84">13 "One Per" -- generating separate files from imported/included schemas</a><ul class="auto-toc"> +<li><a class="reference internal" href="#approach-1-command-line-option-one-file-per-xsd" id="id85">13.1 Approach 1 -- Command line option --one-file-per-xsd</a></li> +<li><a class="reference internal" href="#approach-2-extraction-and-generation-utilities" id="id86">13.2 Approach 2 -- Extraction and generation utilities</a></li> </ul> </li> -<li><a class="reference internal" href="#examples-and-demonstrations" id="id86">15 Examples and demonstrations</a><ul class="auto-toc"> -<li><a class="reference internal" href="#django-generating-models-and-forms" id="id87">15.1 Django -- Generating Models and Forms</a><ul class="auto-toc"> -<li><a class="reference internal" href="#how-to-generate-django-models-and-forms" id="id88">15.1.1 How to generate Django models and forms</a></li> -<li><a class="reference internal" href="#how-it-works" id="id89">15.1.2 How it works</a></li> +<li><a class="reference internal" href="#how-to-modify-the-generated-code" id="id87">14 How to modify the generated code</a><ul class="auto-toc"> +<li><a class="reference internal" href="#adding-features-to-class-definitions" id="id88">14.1 Adding features to class definitions</a></li> </ul> </li> +<li><a class="reference internal" href="#examples-and-demonstrations" id="id89">15 Examples and demonstrations</a><ul class="auto-toc"> +<li><a class="reference internal" href="#django-generating-models-and-forms" id="id90">15.1 Django -- Generating Models and Forms</a><ul class="auto-toc"> +<li><a class="reference internal" href="#how-to-generate-django-models-and-forms" id="id91">15.1.1 How to generate Django models and forms</a></li> +<li><a class="reference internal" href="#how-it-works" id="id92">15.1.2 How it works</a></li> </ul> </li> -<li><a class="reference internal" href="#sample-code-and-extensions" id="id90">16 Sample code and extensions</a><ul class="auto-toc"> -<li><a class="reference internal" href="#capturing-xs-date-elements-as-dates" id="id91">16.1 Capturing xs:date elements as dates</a></li> </ul> </li> -<li><a class="reference internal" href="#limitations-of-generateds" id="id92">17 Limitations of generateDS</a><ul class="auto-toc"> -<li><a class="reference internal" href="#xml-schema-limitations" id="id93">17.1 XML Schema limitations</a></li> +<li><a class="reference internal" href="#sample-code-and-extensions" id="id93">16 Sample code and extensions</a><ul class="auto-toc"> +<li><a class="reference internal" href="#capturing-xs-date-elements-as-dates" id="id94">16.1 Capturing xs:date elements as dates</a></li> </ul> </li> -<li><a class="reference internal" href="#includes-the-xml-schema-xs-include-and-xs-import-elements" id="id94">18 Includes -- The XML schema xs:include and xs:import elements</a></li> -<li><a class="reference internal" href="#processing-relaxng-schemas" id="id95">19 Processing RelaxNG schemas</a></li> -<li><a class="reference internal" href="#acknowledgments" id="id96">20 Acknowledgments</a></li> -<li><a class="reference internal" href="#see-also" id="id97">21 See also</a></li> +<li><a class="reference internal" href="#limitations-of-generateds" id="id95">17 Limitations of generateDS</a><ul class="auto-toc"> +<li><a class="reference internal" href="#xml-schema-limitations" id="id96">17.1 XML Schema limitations</a></li> +</ul> +</li> +<li><a class="reference internal" href="#includes-the-xml-schema-xs-include-and-xs-import-elements" id="id97">18 Includes -- The XML schema xs:include and xs:import elements</a></li> +<li><a class="reference internal" href="#processing-relaxng-schemas" id="id98">19 Processing RelaxNG schemas</a></li> +<li><a class="reference internal" href="#acknowledgments" id="id99">20 Acknowledgments</a></li> +<li><a class="reference internal" href="#see-also" id="id100">21 See also</a></li> </ul> </div> <div class="section" id="introduction"> @@ -610,6 +615,10 @@ Options: the export() method by the generated parse() and parseString() functions. Default=''. + --no-namespace-defs Do not pass namespace definitions as the value + for the namespacedef_ parameter of the export + method, even if it can be extraced from the + schema. --external-encoding=<encoding> Encode output written by the generated export methods using this encoding. Default, if omitted, @@ -850,6 +859,14 @@ specified, then the export function will insert a namespace prefix definition attribute in the top-most (outer-most) element. (Actually, you can insert any attribute.) The default is an empty string.</dd> +<dt>no-namespace-defs</dt> +<dd>Do not pass namespace definitions as the value for the +<tt class="docutils literal">namespacedef_</tt> parameter of the export method, even if it can +be extraced from the schema. The default is off. You might +want to consider using this in combination with the ability to +attach namespace prefix definitions to specific element types +during export, as described here: <a class="reference internal" href="#adding-custom-exported-attributes-and-namespace-prefix-definitions">Adding custom exported +attributes and namespace prefix definitions</a>.</dd> <dt>external-encoding=<encoding></dt> <dd>If an XML instance document contains character data or attribute values that are not in the ASCII character set, then @@ -887,7 +904,7 @@ tree with the node's <tt class="docutils literal">getiterator</tt>, <tt class="d and use any of lxml's other capabilities.</li> </ul> <p class="last">For example: <tt class="docutils literal"><span class="pre">--export="write</span> etree"</tt> and <tt class="docutils literal"><span class="pre">--export="write"</span></tt>. The -default is: <tt class="docutils literal"><span class="pre">--export="write</span> literal"</tt>.</p> +default is: <tt class="docutils literal"><span class="pre">--export="write"</span></tt>.</p> </dd> <dt>preserve-cdata-tags</dt> <dd>Preserve CDATA tags. Normally, CDATA tags ("<![CDATA[ ... ]]>") @@ -1387,8 +1404,8 @@ off validation.</li> generated validation code calls <tt class="docutils literal">gds_validate_xxx</tt>, where "xxx" is a base, simple type. In some cases, you will be able to add additional code to that method to perform custom checking. See -section <a class="reference internal" href="#overridable-methods">Overridable methods</a> for information on how to use and -override that class.</li> +section <a class="reference internal" href="#overridable-methods-generatedssuper-py">Overridable methods -- generatedssuper.py</a> for +information on how to use and override that class.</li> <li>When validation finds data that fails to validate, it generates a warning (using the <tt class="docutils literal">warnings</tt> module from the Python standard library), not an exception, so that processing continues.</li> @@ -2050,9 +2067,9 @@ instance document, it generates a call to a method <tt class="docutils literal"> in the <tt class="docutils literal">GeneratedsSuper</tt> class. This method has a default implementation in the generated code. If your XML schema uses <tt class="docutils literal">xs:any</tt>, you may need to add some code to that default -implementation of <tt class="docutils literal">gds_build_any</tt>. See section <a class="reference internal" href="#overridable-methods">Overridable -methods</a> for guidance on how to provide an implementation of that -method.</p> +implementation of <tt class="docutils literal">gds_build_any</tt>. See section <a class="reference internal" href="#overridable-methods-generatedssuper-py">Overridable +methods -- generatedssuper.py</a> for guidance on how to provide an +implementation of that method.</p> <p>For more help with this, look at the code generated from an XML schema that uses <tt class="docutils literal">xs:any</tt>. In particular, look at the code generated in the Python class corresponding to the @@ -2688,8 +2705,8 @@ source code and the class_name pattern in each specification.</li> <li>Repeat as necessary.</li> </ol> </div> -<div class="section" id="overridable-methods"> -<h2><a class="toc-backref" href="#id81">12.10 Overridable methods</a></h2> +<div class="section" id="overridable-methods-generatedssuper-py"> +<h2><a class="toc-backref" href="#id81">12.10 Overridable methods -- generatedssuper.py</a></h2> <p><tt class="docutils literal">generateDS.py</tt> generates calls to several methods that each have a default implementation in a superclass. The default superclass with default implementations is included in the generated code. @@ -2815,9 +2832,58 @@ that complexType definition. This dictionary is named <tt class="docutils literal">GDSClassesMapping</tt>. You will find it in the module generated with the "-o" option.</p> </div> +<div class="section" id="adding-custom-exported-attributes-and-namespace-prefix-definitions"> +<h2><a class="toc-backref" href="#id83">12.12 Adding custom exported attributes and namespace prefix definitions</a></h2> +<p>You can add additional attributes to exported XML content by (1) +providing a module named <tt class="docutils literal">generatedsnamespaces.py</tt>; (2) placing +that module somewhere so that it can be imported when you "run" your +generated module; and (3) including in <tt class="docutils literal">generatedsnamespaces.py</tt> a +global variable named <tt class="docutils literal">GenerateDSNamespaceDefs</tt> whose value is a +Python dictionary. The keys in this dictionary should be element +type names in the generated module. And the values should be text +strings that are attributes to be added to exported elements of that +type.</p> +<p>Here is an example:</p> +<pre class="literal-block"> +# file: generatedsnamespaces.py + +GenerateDSNamespaceDefs = { + "A1ElementType": 'xmlns:abc="http://www.abc.com/namespace_a1"', + "A2ElementType": 'xmlns:abc="http://www.abc.com/namespace_a2"', +} +</pre> +<p>Notes:</p> +<ul class="simple"> +<li>While the original intension of this facility was to enable the +user to add XML namespace prefix definitions to the XML content in +exported files, you can use it to add other attribute definitions +as well.</li> +<li>If you find that <tt class="docutils literal">generateDS.py</tt> is adding a specific namespace +prefix definition to many exported XML elements and you want to +suppress this behavior, take a look at the <tt class="docutils literal"><span class="pre">--no-namespace-defs</span></tt> +command line option. In particular, this command line option may +be useful when used together with the capability described in this +section (<tt class="docutils literal">generatedsnamespaces.py</tt>).</li> +</ul> +</div> </div> <div class="section" id="one-per-generating-separate-files-from-imported-included-schemas"> -<h1><a class="toc-backref" href="#id83">13 "One Per" -- generating separate files from imported/included schemas</a></h1> +<h1><a class="toc-backref" href="#id84">13 "One Per" -- generating separate files from imported/included schemas</a></h1> +<p>The <tt class="docutils literal">generateDS.py</tt> project provides support for two approaches to +this task:</p> +<ul class="simple"> +<li>The first (<a class="reference internal" href="#approach-1-command-line-option-one-file-per-xsd">Approach 1 -- Command line option +--one-file-per-xsd</a>, below) is likely to be easier to use, but if +it does not work for you as is, it is very difficult to customize.</li> +<li>The second method (<a class="reference internal" href="#approach-2-extraction-and-generation-utilities">Approach 2 -- Extraction and generation +utilities</a>, below) may require a little more work and +understanding, but offers more options and customization, and, +since the scripts that implement it are short and rather simple, +may be easier to customize or even re-write for your specific +needs.</li> +</ul> +<div class="section" id="approach-1-command-line-option-one-file-per-xsd"> +<h2><a class="toc-backref" href="#id85">13.1 Approach 1 -- Command line option --one-file-per-xsd</a></h2> <p>The <tt class="docutils literal"><span class="pre">--one-file-per-xsd</span></tt> command line option enables you to generate a separate Python module for each XML schema that is imported or included (using <tt class="docutils literal"><xs:import></tt> or <tt class="docutils literal"><xs:include></tt>) by @@ -2869,12 +2935,54 @@ directory into a Python package.</p> </li> </ul> </div> +<div class="section" id="approach-2-extraction-and-generation-utilities"> +<h2><a class="toc-backref" href="#id86">13.2 Approach 2 -- Extraction and generation utilities</a></h2> +<p>The <tt class="docutils literal">generateds/utils</tt> subdirectory contains two utility scripts +that may help with this task. The procedure is as follows:</p> +<ol class="arabic simple"> +<li>First, use <tt class="docutils literal">utils/collect_schema_locations.py</tt> to collect a set +of directives, one for each (included) schema and each module to +be generated. This utility writes out a JSON file that contains +the directives to be used in the next step.</li> +<li>Next, use <tt class="docutils literal">utils/batch_generate.py</tt> to generate one module (or +perhaps two modules, see below) for each directive in that JSON +file.</li> +</ol> +<p>Each of these modules gives a reasonable amount of usage information +in response to the <tt class="docutils literal"><span class="pre">--help</span></tt> command line option.</p> +<p>A few hints and suggestions:</p> +<ul class="simple"> +<li>After generating the JSON directives file you can modify it with +your text editor. For example, (1) you can add the name of +sub-class modules to be generated by <tt class="docutils literal">generateDS.py</tt>; (2) you +can specify command line options to be used by <tt class="docutils literal">generateDS.py</tt> +when generating specific modules; and (3) you can add new +directives to generate additional modules.</li> +<li>If you find yourself typing the same command line options to +<tt class="docutils literal">utils/batch_generate.py</tt> over and over, there is a facility to +put command line options that have long names (i.e., not one +character names) into a configuration file. The usage information +produced by <tt class="docutils literal">utils/batch_generate.py <span class="pre">--help</span></tt> shows an example. +Then use <tt class="docutils literal">utils/batch_generate.py <span class="pre">--config=myoptins.config</span> ...</tt> +to feed this configuration file to <tt class="docutils literal">utils/batch_generate.py</tt>. +The options in this configuration file can be overridden by those +entered on the command line.</li> +<li>The JSON directives file can contain comments, even though this is +not part of the JSON standard. A comment is any line that begins +with "//" where the "//" is proceeded only by white space +characters. <tt class="docutils literal">utils/batch_generate.py</tt> strips these lines out +before parsing the JSON file. However, if you plan to process +this JSON file with other processes, you will likely either not +want to add comments or plan to pre-process them in some way.</li> +</ul> +</div> +</div> <div class="section" id="how-to-modify-the-generated-code"> -<h1><a class="toc-backref" href="#id84">14 How to modify the generated code</a></h1> +<h1><a class="toc-backref" href="#id87">14 How to modify the generated code</a></h1> <p>This section attempts to explain how to modify and add features to the generated code.</p> <div class="section" id="adding-features-to-class-definitions"> -<h2><a class="toc-backref" href="#id85">14.1 Adding features to class definitions</a></h2> +<h2><a class="toc-backref" href="#id88">14.1 Adding features to class definitions</a></h2> <p>You can add new member definitions to a generated class. Look at the 'export' and 'exportLiteral' member functions for examples of how to access member variables and how to walk nested @@ -2919,7 +3027,7 @@ parser, for example, since generating the file.</li> </div> </div> <div class="section" id="examples-and-demonstrations"> -<h1><a class="toc-backref" href="#id86">15 Examples and demonstrations</a></h1> +<h1><a class="toc-backref" href="#id89">15 Examples and demonstrations</a></h1> <p>Under the directory Demos are several examples:</p> <ul class="simple"> <li>Demos/People provides a simple demonstration of generating @@ -2945,7 +3053,7 @@ containing explicit control logic, the order in which nodes of the parsed XML document are visited is under your control.</li> </ul> <div class="section" id="django-generating-models-and-forms"> -<h2><a class="toc-backref" href="#id87">15.1 Django -- Generating Models and Forms</a></h2> +<h2><a class="toc-backref" href="#id90">15.1 Django -- Generating Models and Forms</a></h2> <p><tt class="docutils literal">generateDS.py</tt> can be used to generate Django models and Django forms that represent the data structures defined in an XML Schema.</p> <p><strong>Note:</strong> In order to use this capability, you must obtain the @@ -2979,7 +3087,7 @@ use the "-p" command line option. For more information, do:</p> python gends_run_gen_django.py --help </pre> <div class="section" id="how-to-generate-django-models-and-forms"> -<h3><a class="toc-backref" href="#id88">15.1.1 How to generate Django models and forms</a></h3> +<h3><a class="toc-backref" href="#id91">15.1.1 How to generate Django models and forms</a></h3> <p><strong>Warning:</strong> Running this script attempts to over-write the following files in the current directory:</p> <ul class="simple"> @@ -3027,7 +3135,7 @@ Django application.</p> </ol> </div> <div class="section" id="how-it-works"> -<h3><a class="toc-backref" href="#id89">15.1.2 How it works</a></h3> +<h3><a class="toc-backref" href="#id92">15.1.2 How it works</a></h3> <p>Here are a few notes that might be helpful if and when you need to do some debugging or extend the current capabilities or write a new "meta-app" that uses the same approach but does something new and @@ -3054,9 +3162,9 @@ root super class of all generated data representation classes.</p> </div> </div> <div class="section" id="sample-code-and-extensions"> -<h1><a class="toc-backref" href="#id90">16 Sample code and extensions</a></h1> +<h1><a class="toc-backref" href="#id93">16 Sample code and extensions</a></h1> <div class="section" id="capturing-xs-date-elements-as-dates"> -<h2><a class="toc-backref" href="#id91">16.1 Capturing xs:date elements as dates</a></h2> +<h2><a class="toc-backref" href="#id94">16.1 Capturing xs:date elements as dates</a></h2> <p>The following extension employs a user method (see <a class="reference internal" href="#user-methods">User Methods</a>) in order to capture elements defined as xs:date as date objects.</p> @@ -3125,9 +3233,9 @@ import types </div> </div> <div class="section" id="limitations-of-generateds"> -<h1><a class="toc-backref" href="#id92">17 Limitations of generateDS</a></h1> +<h1><a class="toc-backref" href="#id95">17 Limitations of generateDS</a></h1> <div class="section" id="xml-schema-limitations"> -<h2><a class="toc-backref" href="#id93">17.1 XML Schema limitations</a></h2> +<h2><a class="toc-backref" href="#id96">17.1 XML Schema limitations</a></h2> <p>There are things in Xschema that are not supported. You will have to use a restricted sub-set of Xschema to define your data structures. See above for supported features. See people.xsd and @@ -3137,7 +3245,7 @@ does not work.</p> </div> </div> <div class="section" id="includes-the-xml-schema-xs-include-and-xs-import-elements"> -<h1><a class="toc-backref" href="#id94">18 Includes -- The XML schema xs:include and xs:import elements</a></h1> +<h1><a class="toc-backref" href="#id97">18 Includes -- The XML schema xs:include and xs:import elements</a></h1> <p>While <tt class="docutils literal">generateDS.py</tt> itself does not process XML Schema <tt class="docutils literal">include</tt> elements, the distribution provides a script <tt class="docutils literal">process_includes.py</tt> that can be used as a preprocessor. @@ -3171,7 +3279,7 @@ $ python process_includes.py --help </pre> </div> <div class="section" id="processing-relaxng-schemas"> -<h1><a class="toc-backref" href="#id95">19 Processing RelaxNG schemas</a></h1> +<h1><a class="toc-backref" href="#id98">19 Processing RelaxNG schemas</a></h1> <p>RelaxNG is a schema definition language and is an alternative to XML Schema. For more information on RelaxNG, see: <a class="reference external" href="http://relaxng.org/">http://relaxng.org/</a>.</p> <p><tt class="docutils literal">generateDS.py</tt> does not understand or process RelaxNG schemas. @@ -3212,7 +3320,7 @@ through <tt class="docutils literal">generateDS.py</tt>:</p> <a class="reference external" href="https://github.com/relaxng/jing-trang">https://github.com/relaxng/jing-trang</a></p> </div> <div class="section" id="acknowledgments"> -<h1><a class="toc-backref" href="#id96">20 Acknowledgments</a></h1> +<h1><a class="toc-backref" href="#id99">20 Acknowledgments</a></h1> <p>Many thanks to those who have used <tt class="docutils literal">generateDS.py</tt> and have contributed their comments and suggestions. These comments have been valuable both in teaching me about things I needed to know in @@ -3226,7 +3334,7 @@ following among others:</p> </ul> </div> <div class="section" id="see-also"> -<h1><a class="toc-backref" href="#id97">21 See also</a></h1> +<h1><a class="toc-backref" href="#id100">21 See also</a></h1> <p><a class="reference external" href="http://www.python.org">Python</a>: The Python home page.</p> <p><a class="reference external" href="http://www.davekuhlman.org">Dave's Page</a>: My home page, which contains more Python stuff.</p> <!-- vim:ft=rst: --> @@ -3235,7 +3343,7 @@ following among others:</p> <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateDS.txt">View document source</a>. -Generated on: 2017-05-09 21:57 UTC. +Generated on: 2017-06-01 16:00 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/generateDS.py b/generateDS.py index 54f26f7..632f573 100755 --- a/generateDS.py +++ b/generateDS.py @@ -80,6 +80,10 @@ Options: the export() method by the generated parse() and parseString() functions. Default=''. + --no-namespace-defs Do not pass namespace definitions as the value + for the namespacedef_ parameter of the export + method, even if it can be extraced from the + schema. --external-encoding=<encoding> Encode output written by the generated export methods using this encoding. Default, if omitted, @@ -213,7 +217,7 @@ logging.disable(logging.INFO) # Do not modify the following VERSION comments. # Used by updateversion.py. ##VERSION## -VERSION = '2.26a' +VERSION = '2.27a' ##VERSION## if sys.version_info.major == 2: @@ -244,6 +248,7 @@ NoVersion = False Dirpath = [] ExternalEncoding = sys.getdefaultencoding() Namespacedef = '' +NoNameSpaceDefs = False CleanupNameList = [(re.compile('[-:.]'), '_')] NamespacesDict = {} @@ -2846,6 +2851,10 @@ def generateExportFn(wrt, prefix, element, namespace, nameSpacesDef): wrt(" def export(self, outfile, level, namespace_='%s', " "name_='%s', namespacedef_='%s', pretty_print=True):\n" % (namespace, name, nameSpacesDef)) + wrt(" imported_ns_def_ = GenerateDSNamespaceDefs_.get" + "('%s')\n" % (name, )) + wrt(" if imported_ns_def_ is not None:\n") + wrt(" namespacedef_ = imported_ns_def_\n") wrt(' if pretty_print:\n') wrt(" eol_ = '\\n'\n") wrt(' else:\n') @@ -5030,7 +5039,34 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = {{ +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# }} +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs \ +as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {{}} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -6478,7 +6514,10 @@ def getUsedNamespacesDefs(element): def generateFromTree(wrt, prefix, elements, processed): for element in elements: - nameSpacesDef = getUsedNamespacesDefs(element) + if NoNameSpaceDefs: + nameSpacesDef = "" + else: + nameSpacesDef = getUsedNamespacesDefs(element) name = element.getCleanName() if 1: # if name not in processed: processed.append(name) @@ -6573,7 +6612,8 @@ def generate(outfileName, subclassFilename, behaviorFilename, if not isNewState(): sys.stderr.write('\n*** maxLoops exceeded. Something is ' 'wrong with --one-file-per-xsd.\n\n') - sys.stderr.write('*** Failed to process the following element ' + sys.stderr.write( + '*** Failed to process the following element ' 'definitions:\n %s\n' % (PostponedExtensions)) break element = PostponedExtensions.pop() @@ -6960,7 +7000,7 @@ def main(): global Force, GenerateProperties, SubclassSuffix, RootElement, \ ValidatorBodiesBasePath, UseGetterSetter, \ UserMethodsPath, XsdNameSpace, \ - Namespacedef, NoDates, NoVersion, \ + Namespacedef, NoNameSpaceDefs, NoDates, NoVersion, \ TEMPLATE_MAIN, TEMPLATE_SUBCLASS_FOOTER, Dirpath, \ ExternalEncoding, MemberSpecs, NoQuestions, \ ExportWrite, ExportEtree, ExportLiteral, \ @@ -6978,7 +7018,7 @@ def main(): 'root-element=', 'super=', 'validator-bodies=', 'use-getter-setter=', 'user-methods=', 'no-process-includes', 'silence', - 'namespacedef=', 'external-encoding=', + 'namespacedef=', 'no-namespace-defs', 'external-encoding=', 'member-specs=', 'no-dates', 'no-versions', 'no-questions', 'session=', 'fix-type-names=', 'version', 'export=', @@ -6998,6 +7038,7 @@ def main(): superModule = '???' processIncludes = 1 namespacedef = '' + NoNameSpaceDefs = False ExternalEncoding = sys.getdefaultencoding() NoDates = False NoVersion = False @@ -7139,6 +7180,8 @@ def main(): outputText = False elif option[0] == "--namespacedef": namespacedef = option[1] + elif option[0] == "--no-namespace-defs": + NoNameSpaceDefs = True elif option[0] == '--external-encoding': ExternalEncoding = option[1] elif option[0] in ('-q', '--no-questions'): diff --git a/generateDS.txt b/generateDS.txt index d3a572a..fba8742 100644 --- a/generateDS.txt +++ b/generateDS.txt @@ -12,7 +12,7 @@ generateDS -- Generate Data Structures from XML Schema .. version -:revision: 2.26a +:revision: 2.27a .. version @@ -302,6 +302,10 @@ Here is the usage message displayed by ``generateDS.py``:: the export() method by the generated parse() and parseString() functions. Default=''. + --no-namespace-defs Do not pass namespace definitions as the value + for the namespacedef_ parameter of the export + method, even if it can be extraced from the + schema. --external-encoding=<encoding> Encode output written by the generated export methods using this encoding. Default, if omitted, @@ -564,6 +568,15 @@ namespacedef="<http://...>" element. (Actually, you can insert any attribute.) The default is an empty string. +no-namespace-defs + Do not pass namespace definitions as the value for the + ``namespacedef_`` parameter of the export method, even if it can + be extraced from the schema. The default is off. You might + want to consider using this in combination with the ability to + attach namespace prefix definitions to specific element types + during export, as described here: `Adding custom exported + attributes and namespace prefix definitions`_. + external-encoding=<encoding> If an XML instance document contains character data or attribute values that are not in the ASCII character set, then @@ -605,7 +618,7 @@ export and use any of lxml's other capabilities. For example: ``--export="write etree"`` and ``--export="write"``. The - default is: ``--export="write literal"``. + default is: ``--export="write"``. preserve-cdata-tags Preserve CDATA tags. Normally, CDATA tags ("<![CDATA[ ... ]]>") @@ -1160,8 +1173,8 @@ Here is a bit of explanation of what that generated code will do. generated validation code calls ``gds_validate_xxx``, where "xxx" is a base, simple type. In some cases, you will be able to add additional code to that method to perform custom checking. See - section `Overridable methods`_ for information on how to use and - override that class. + section `Overridable methods -- generatedssuper.py`_ for + information on how to use and override that class. - When validation finds data that fails to validate, it generates a warning (using the ``warnings`` module from the Python standard @@ -1879,8 +1892,8 @@ in the ``GeneratedsSuper`` class. This method has a default implementation in the generated code. If your XML schema uses ``xs:any``, you may need to add some code to that default implementation of ``gds_build_any``. See section `Overridable -methods`_ for guidance on how to provide an implementation of that -method. +methods -- generatedssuper.py`_ for guidance on how to provide an +implementation of that method. For more help with this, look at the code generated from an XML schema that uses ``xs:any``. In particular, look at the code @@ -2587,8 +2600,8 @@ Suggestion -- How to begin: .. _`gends_user_methods.py`: https://bitbucket.org/dkuhlman/generateds/src -Overridable methods ----------------------------- +Overridable methods -- generatedssuper.py +------------------------------------------- ``generateDS.py`` generates calls to several methods that each have a default implementation in a superclass. The default superclass @@ -2723,9 +2736,64 @@ that complexType definition. This dictionary is named with the "-o" option. +Adding custom exported attributes and namespace prefix definitions +-------------------------------------------------------------------- + +You can add additional attributes to exported XML content by (1) +providing a module named ``generatedsnamespaces.py``; (2) placing +that module somewhere so that it can be imported when you "run" your +generated module; and (3) including in ``generatedsnamespaces.py`` a +global variable named ``GenerateDSNamespaceDefs`` whose value is a +Python dictionary. The keys in this dictionary should be element +type names in the generated module. And the values should be text +strings that are attributes to be added to exported elements of that +type. + +Here is an example:: + + # file: generatedsnamespaces.py + + GenerateDSNamespaceDefs = { + "A1ElementType": 'xmlns:abc="http://www.abc.com/namespace_a1"', + "A2ElementType": 'xmlns:abc="http://www.abc.com/namespace_a2"', + } + +Notes: + +- While the original intension of this facility was to enable the + user to add XML namespace prefix definitions to the XML content in + exported files, you can use it to add other attribute definitions + as well. + +- If you find that ``generateDS.py`` is adding a specific namespace + prefix definition to many exported XML elements and you want to + suppress this behavior, take a look at the ``--no-namespace-defs`` + command line option. In particular, this command line option may + be useful when used together with the capability described in this + section (``generatedsnamespaces.py``). + + "One Per" -- generating separate files from imported/included schemas ======================================================================= +The ``generateDS.py`` project provides support for two approaches to +this task: + +- The first (`Approach 1 -- Command line option + --one-file-per-xsd`_, below) is likely to be easier to use, but if + it does not work for you as is, it is very difficult to customize. + +- The second method (`Approach 2 -- Extraction and generation + utilities`_, below) may require a little more work and + understanding, but offers more options and customization, and, + since the scripts that implement it are short and rather simple, + may be easier to customize or even re-write for your specific + needs. + + +Approach 1 -- Command line option --one-file-per-xsd +---------------------------------------------------------- + The ``--one-file-per-xsd`` command line option enables you to generate a separate Python module for each XML schema that is imported or included (using ``<xs:import>`` or ``<xs:include>``) by @@ -2778,6 +2846,52 @@ Here are a few hints, guidelines, and suggestions: directory into a Python package. +Approach 2 -- Extraction and generation utilities +--------------------------------------------------- + +The ``generateds/utils`` subdirectory contains two utility scripts +that may help with this task. The procedure is as follows: + +1. First, use ``utils/collect_schema_locations.py`` to collect a set + of directives, one for each (included) schema and each module to + be generated. This utility writes out a JSON file that contains + the directives to be used in the next step. + +2. Next, use ``utils/batch_generate.py`` to generate one module (or + perhaps two modules, see below) for each directive in that JSON + file. + +Each of these modules gives a reasonable amount of usage information +in response to the ``--help`` command line option. + +A few hints and suggestions: + +- After generating the JSON directives file you can modify it with + your text editor. For example, (1) you can add the name of + sub-class modules to be generated by ``generateDS.py``; (2) you + can specify command line options to be used by ``generateDS.py`` + when generating specific modules; and (3) you can add new + directives to generate additional modules. + +- If you find yourself typing the same command line options to + ``utils/batch_generate.py`` over and over, there is a facility to + put command line options that have long names (i.e., not one + character names) into a configuration file. The usage information + produced by ``utils/batch_generate.py --help`` shows an example. + Then use ``utils/batch_generate.py --config=myoptins.config ...`` + to feed this configuration file to ``utils/batch_generate.py``. + The options in this configuration file can be overridden by those + entered on the command line. + +- The JSON directives file can contain comments, even though this is + not part of the JSON standard. A comment is any line that begins + with "//" where the "//" is proceeded only by white space + characters. ``utils/batch_generate.py`` strips these lines out + before parsing the JSON file. However, if you plan to process + this JSON file with other processes, you will likely either not + want to add comments or plan to pre-process them in some way. + + How to modify the generated code ================================ diff --git a/generateds_gui_notes.html b/generateds_gui_notes.html index a34f76b..275359d 100644 --- a/generateds_gui_notes.html +++ b/generateds_gui_notes.html @@ -220,7 +220,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.26a</td> +<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.27a</td> </tr> </tbody> </table> @@ -229,7 +229,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">May 09, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">June 01, 2017</td> </tr> </tbody> </table> @@ -401,7 +401,7 @@ $ mv generateds_gui.mo locale/ru/LC_MESSAGES/ <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateds_gui_notes.txt">View document source</a>. -Generated on: 2017-05-09 21:57 UTC. +Generated on: 2017-06-01 16:00 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/generateds_gui_notes.txt b/generateds_gui_notes.txt index 49d17c2..ac0da3a 100644 --- a/generateds_gui_notes.txt +++ b/generateds_gui_notes.txt @@ -12,7 +12,7 @@ GenerateDS GUI Notes .. version -:revision: 2.26a +:revision: 2.27a .. version diff --git a/gui/generateds_gui.py b/gui/generateds_gui.py index 5a7e6a4..a7e3541 100755 --- a/gui/generateds_gui.py +++ b/gui/generateds_gui.py @@ -41,7 +41,7 @@ from libgenerateDS.gui import generateds_gui_session # Do not modify the following VERSION comments. # Used by updateversion.py. ##VERSION## -VERSION = '2.26a' +VERSION = '2.27a' ##VERSION## diff --git a/librarytemplate_howto.html b/librarytemplate_howto.html index 5d3738a..8e4978e 100644 --- a/librarytemplate_howto.html +++ b/librarytemplate_howto.html @@ -217,7 +217,7 @@ dkuhlman (at) davekuhlman (dot) org <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.26a</td> +<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.27a</td> </tr> </tbody> </table> @@ -226,7 +226,7 @@ dkuhlman (at) davekuhlman (dot) org <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">May 09, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">June 01, 2017</td> </tr> </tbody> </table> @@ -380,7 +380,7 @@ this command for your needs. For example, you may need to use <div class="footer"> <hr class="footer" /> <a class="reference external" href="librarytemplate_howto.txt">View document source</a>. -Generated on: 2017-05-09 21:57 UTC. +Generated on: 2017-06-01 16:00 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/librarytemplate_howto.txt b/librarytemplate_howto.txt index 28383c0..808eeb8 100644 --- a/librarytemplate_howto.txt +++ b/librarytemplate_howto.txt @@ -8,7 +8,7 @@ How to package a generateDS.py generated library .. version -:revision: 2.26a +:revision: 2.27a .. version diff --git a/process_includes.py b/process_includes.py index e030a21..43aa474 100755 --- a/process_includes.py +++ b/process_includes.py @@ -40,7 +40,7 @@ except ImportError: # Do not modify the following VERSION comments. # Used by updateversion.py. ##VERSION## -VERSION = '2.26a' +VERSION = '2.27a' ##VERSION## CatalogDict = {} @@ -89,16 +89,19 @@ def process_include_files( return doc -def get_all_root_file_paths(infile, inpath='', catalogpath=None): +def get_all_root_file_paths( + infile, + inpath='', + catalogpath=None, + shallow=False): load_catalog(catalogpath) - doc1 = etree.parse(infile) root1 = doc1.getroot() rootPaths = [] params = Params() params.parent_url = infile params.base_url = os.path.split(inpath)[0] - get_root_file_paths(root1, params, rootPaths) + get_root_file_paths(root1, params, rootPaths, shallow) rootPaths.append(inpath) return rootPaths @@ -266,26 +269,24 @@ def collect_inserts_aux(child, params, inserts, options): return roots -def get_root_file_paths(node, params, rootPaths): - +def get_root_file_paths(node, params, rootPaths, shallow): namespace = node.nsmap[node.prefix] child_iter1 = node.iterfind('{%s}include' % (namespace, )) child_iter2 = node.iterfind('{%s}import' % (namespace, )) for child in itertools.chain(child_iter1, child_iter2): - get_root_file_paths_aux(child, params, rootPaths) + get_root_file_paths_aux(child, params, rootPaths, shallow) -def get_root_file_paths_aux(child, params, rootPaths): +def get_root_file_paths_aux(child, params, rootPaths, shallow): save_base_url = params.base_url path, _ = get_ref_info(child, params) string_content = resolve_ref(child, params, None) if string_content is not None: - root = etree.fromstring(string_content, base_url=params.base_url) - get_root_file_paths(root, params, rootPaths) - + if not shallow: + root = etree.fromstring(string_content, base_url=params.base_url) + get_root_file_paths(root, params, rootPaths, shallow) if path is not None and path not in rootPaths: rootPaths.append(path) - params.base_url = save_base_url diff --git a/setup.py b/setup.py index 6be7d96..0e95961 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup(name="generateDS", # Do not modify the following VERSION comments. # Used by updateversion.py. ##VERSION## - version="2.26a", + version="2.27a", ##VERSION## author="Dave Kuhlman", author_email="dkuhlman@davekuhlman.org", diff --git a/tests/OnePer/oneperType00_2One.py b/tests/OnePer/oneperType00_2One.py index 96ad398..143ef3d 100644 --- a/tests/OnePer/oneperType00_2One.py +++ b/tests/OnePer/oneperType00_2One.py @@ -56,7 +56,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -699,6 +725,9 @@ class oneperType00_1(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='oneperType00_1', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('oneperType00_1') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/OnePer/oneperType01_2One.py b/tests/OnePer/oneperType01_2One.py index 6b9aec3..40f336a 100644 --- a/tests/OnePer/oneperType01_2One.py +++ b/tests/OnePer/oneperType01_2One.py @@ -56,7 +56,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -699,6 +725,9 @@ class oneperType01_1(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='oneperType01_1', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('oneperType01_1') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -780,6 +809,9 @@ class oneperType01_2(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='oneperType01_2', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('oneperType01_2') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/OnePer/oneperType02_2One.py b/tests/OnePer/oneperType02_2One.py index 55cbdf0..55b6045 100644 --- a/tests/OnePer/oneperType02_2One.py +++ b/tests/OnePer/oneperType02_2One.py @@ -56,7 +56,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -699,6 +725,9 @@ class oneperType02_1(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='oneperType02_1', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('oneperType02_1') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -780,6 +809,9 @@ class oneperType02_2(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='oneperType02_2', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('oneperType02_2') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/OnePer/oneperType03_2One.py b/tests/OnePer/oneperType03_2One.py index f34f726..5095a66 100644 --- a/tests/OnePer/oneperType03_2One.py +++ b/tests/OnePer/oneperType03_2One.py @@ -56,7 +56,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -699,6 +725,9 @@ class oneperType03_1(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='oneperType03_1', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('oneperType03_1') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -780,6 +809,9 @@ class oneperType03_2(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='oneperType03_2', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('oneperType03_2') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/abstract_type1_sup.py b/tests/abstract_type1_sup.py index 7d63ed1..643efb6 100644 --- a/tests/abstract_type1_sup.py +++ b/tests/abstract_type1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -699,6 +725,9 @@ class carrierType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='target:', name_='carrierType', namespacedef_='xmlns:target="http://cars.example.com/schema"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('carrierType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -786,6 +815,9 @@ class Vehicle(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='target:', name_='Vehicle', namespacedef_='xmlns:target="http://cars.example.com/schema"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('Vehicle') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -854,6 +886,9 @@ class Car(Vehicle): else: return False def export(self, outfile, level, namespace_='target:', name_='Car', namespacedef_='xmlns:target="http://cars.example.com/schema"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('Car') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -917,6 +952,9 @@ class Plane(Vehicle): else: return False def export(self, outfile, level, namespace_='target:', name_='Plane', namespacedef_='xmlns:target="http://cars.example.com/schema"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('Plane') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/annotations1_sup.py b/tests/annotations1_sup.py index f7b7f4c..d716c96 100644 --- a/tests/annotations1_sup.py +++ b/tests/annotations1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -701,6 +727,9 @@ class document1Type(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='document1Type', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('document1Type') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -795,6 +824,9 @@ class document2Type(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='document2Type', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('document2Type') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -893,6 +925,9 @@ class document3Type(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='document3Type', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('document3Type') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/anonymous_type1_sup.py b/tests/anonymous_type1_sup.py index 54f4775..ac77e9c 100644 --- a/tests/anonymous_type1_sup.py +++ b/tests/anonymous_type1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -703,6 +729,9 @@ class FooList(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='FooList', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('FooList') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -799,6 +828,9 @@ class FooType1(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='FooType1', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('FooType1') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -883,6 +915,9 @@ class BarType2(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='BarType2', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('BarType2') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -967,6 +1002,9 @@ class BazType3(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='BazType3', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('BazType3') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/anysimpletype1_sup.py b/tests/anysimpletype1_sup.py index 37b25dc..7122f86 100644 --- a/tests/anysimpletype1_sup.py +++ b/tests/anysimpletype1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -697,6 +723,9 @@ class test1element(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='test1element', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('test1element') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -779,6 +808,9 @@ class cimAnySimpleType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='cimAnySimpleType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('cimAnySimpleType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/anywildcard1_sup.py b/tests/anywildcard1_sup.py index fc9d2dd..bc06e7d 100644 --- a/tests/anywildcard1_sup.py +++ b/tests/anywildcard1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -703,6 +729,9 @@ class PlantType_single(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='PlantType_single', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('PlantType_single') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -805,6 +834,9 @@ class PlantType_multiple(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='PlantType_multiple', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('PlantType_multiple') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -898,6 +930,9 @@ class DescriptionType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='DescriptionType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('DescriptionType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -985,6 +1020,9 @@ class CatalogType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='CatalogType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('CatalogType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1070,6 +1108,9 @@ class PlantType_single_nochild(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='PlantType_single_nochild', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('PlantType_single_nochild') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1147,6 +1188,9 @@ class PlantType_multiple_nochild(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='PlantType_multiple_nochild', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('PlantType_multiple_nochild') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/attr_groups1_sup.py b/tests/attr_groups1_sup.py index 064f970..49e3fdb 100644 --- a/tests/attr_groups1_sup.py +++ b/tests/attr_groups1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -729,6 +755,9 @@ class GetUserReq(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='GetUserReq', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('GetUserReq') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/catalogtest1_sup.py b/tests/catalogtest1_sup.py index 0822668..94fef33 100644 --- a/tests/catalogtest1_sup.py +++ b/tests/catalogtest1_sup.py @@ -56,7 +56,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class diff --git a/tests/cdata1_sup.py b/tests/cdata1_sup.py index 3ddcfae..81149c2 100644 --- a/tests/cdata1_sup.py +++ b/tests/cdata1_sup.py @@ -56,7 +56,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -700,6 +726,9 @@ class cdataListType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='cdataListType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('cdataListType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -774,6 +803,9 @@ class cdataType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='cdataType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('cdataType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/cleanupname1_sup.py b/tests/cleanupname1_sup.py index ce85f41..11983e9 100644 --- a/tests/cleanupname1_sup.py +++ b/tests/cleanupname1_sup.py @@ -56,7 +56,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -714,6 +740,9 @@ class dataKind(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='dataType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('dataType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -816,6 +845,9 @@ class data1Kind(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='data1Type', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('data1Type') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -890,6 +922,9 @@ class MlassData2(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='TypeData2', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('TypeData2') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -964,6 +999,9 @@ class RealTypeData3(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='RealTypeData3', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('RealTypeData3') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1038,6 +1076,9 @@ class MMMMMMdataKind(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='AABBCCdataType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('AABBCCdataType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1112,6 +1153,9 @@ class dataTypeNNNMNNN(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='dataTypeXYZAXYZ', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('dataTypeXYZAXYZ') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/defaults_cases1_sup.py b/tests/defaults_cases1_sup.py index 6a6b5dc..4482304 100644 --- a/tests/defaults_cases1_sup.py +++ b/tests/defaults_cases1_sup.py @@ -54,7 +54,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -709,6 +735,9 @@ class DefaultTypes(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='DefaultTypes', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('DefaultTypes') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -825,6 +854,9 @@ class DefaultType1(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='DefaultType1', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('DefaultType1') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -984,6 +1016,9 @@ class DefaultType2(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='DefaultType2', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('DefaultType2') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/defaults_coverage1_sup.py b/tests/defaults_coverage1_sup.py index 7808d17..534c099 100644 --- a/tests/defaults_coverage1_sup.py +++ b/tests/defaults_coverage1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -698,6 +724,9 @@ class DefaultTypes(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='DefaultTypes', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('DefaultTypes') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -883,6 +912,9 @@ class DefaultType1(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='DefaultType1', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('DefaultType1') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1215,6 +1247,9 @@ class DefaultType2(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='DefaultType2', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('DefaultType2') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/extensions1_sup.py b/tests/extensions1_sup.py index 18b6c74..6eb4a46 100644 --- a/tests/extensions1_sup.py +++ b/tests/extensions1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -697,6 +723,9 @@ class SpecialDate(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='SpecialDate', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('SpecialDate') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -772,6 +801,9 @@ class ExtremeDate(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='ExtremeDate', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('ExtremeDate') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -847,6 +879,9 @@ class singleExtremeDate(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='singleExtremeDate', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('singleExtremeDate') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -929,6 +964,9 @@ class containerType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='containerType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('containerType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1041,6 +1079,9 @@ class simpleFactoidType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleFactoidType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleFactoidType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1162,6 +1203,9 @@ class mixedFactoidType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='mixedFactoidType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('mixedFactoidType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1253,6 +1297,9 @@ class BaseType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='BaseType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('BaseType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1349,6 +1396,9 @@ class DerivedType(BaseType): else: return False def export(self, outfile, level, namespace_='', name_='DerivedType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('DerivedType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1434,6 +1484,9 @@ class MyInteger(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='MyInteger', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('MyInteger') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1509,6 +1562,9 @@ class MyBoolean(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='MyBoolean', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('MyBoolean') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1584,6 +1640,9 @@ class MyFloat(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='MyFloat', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('MyFloat') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1659,6 +1718,9 @@ class MyDouble(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='MyDouble', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('MyDouble') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/ipo1_sup.py b/tests/ipo1_sup.py index a810324..34ba227 100644 --- a/tests/ipo1_sup.py +++ b/tests/ipo1_sup.py @@ -54,7 +54,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -715,6 +741,9 @@ class PurchaseOrderType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='PurchaseOrderType', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('PurchaseOrderType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -826,6 +855,9 @@ class Items(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='Items', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('Items') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -928,6 +960,9 @@ class item(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='item', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('item') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1042,6 +1077,9 @@ class quantity(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='quantity', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('quantity') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1119,6 +1157,9 @@ class Address(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='Address', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('Address') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1234,6 +1275,9 @@ class USAddress(Address): else: return False def export(self, outfile, level, namespace_='ipo:', name_='USAddress', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('USAddress') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1331,6 +1375,9 @@ class UKAddress(Address): else: return False def export(self, outfile, level, namespace_='ipo:', name_='UKAddress', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('UKAddress') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/ipo2_sup.py b/tests/ipo2_sup.py index a810324..34ba227 100644 --- a/tests/ipo2_sup.py +++ b/tests/ipo2_sup.py @@ -54,7 +54,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -715,6 +741,9 @@ class PurchaseOrderType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='PurchaseOrderType', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('PurchaseOrderType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -826,6 +855,9 @@ class Items(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='Items', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('Items') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -928,6 +960,9 @@ class item(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='item', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('item') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1042,6 +1077,9 @@ class quantity(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='quantity', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('quantity') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1119,6 +1157,9 @@ class Address(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='ipo:', name_='Address', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('Address') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1234,6 +1275,9 @@ class USAddress(Address): else: return False def export(self, outfile, level, namespace_='ipo:', name_='USAddress', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('USAddress') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1331,6 +1375,9 @@ class UKAddress(Address): else: return False def export(self, outfile, level, namespace_='ipo:', name_='UKAddress', namespacedef_='xmlns:ipo="http://www.example.com/IPO"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('UKAddress') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/mapcleanname1_sup.py b/tests/mapcleanname1_sup.py index f6017af..96a479b 100644 --- a/tests/mapcleanname1_sup.py +++ b/tests/mapcleanname1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -714,6 +740,9 @@ class complex_type01(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='complex-type01', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('complex-type01') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -836,6 +865,9 @@ class complex_type02(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='complex-type02', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('complex-type02') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -957,6 +989,9 @@ class complex_type03(complex_type02): else: return False def export(self, outfile, level, namespace_='', name_='complex-type03', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('complex-type03') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1074,6 +1109,9 @@ class type_(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='type', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('type') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1195,6 +1233,9 @@ class complex_type04(type_): else: return False def export(self, outfile, level, namespace_='', name_='complex-type04', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('complex-type04') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1312,6 +1353,9 @@ class build_(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='build', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('build') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1433,6 +1477,9 @@ class complex_type05(build_): else: return False def export(self, outfile, level, namespace_='', name_='complex-type05', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('complex-type05') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/nested_def1_sup.py b/tests/nested_def1_sup.py index 8607979..9ead07e 100644 --- a/tests/nested_def1_sup.py +++ b/tests/nested_def1_sup.py @@ -54,7 +54,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -697,6 +723,9 @@ class containerType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='containerType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('containerType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -778,6 +807,9 @@ class classAType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='classAType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('classAType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -852,6 +884,9 @@ class classBType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='classBType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('classBType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -930,6 +965,9 @@ class innerType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='innerType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('innerType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1010,6 +1048,9 @@ class innerType1(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='innerType1', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('innerType1') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/out1_sup.py b/tests/out1_sup.py index 3530bab..24fa5f7 100644 --- a/tests/out1_sup.py +++ b/tests/out1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -743,6 +769,9 @@ class people(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='people', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('people') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -987,6 +1016,9 @@ class comments(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='comments', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('comments') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1197,6 +1229,9 @@ class person(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='person', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('person') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1578,6 +1613,9 @@ class programmer(person): else: return False def export(self, outfile, level, namespace_='', name_='programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1984,6 +2022,9 @@ class param(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='param', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('param') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2178,6 +2219,9 @@ class python_programmer(programmer): else: return False def export(self, outfile, level, namespace_='', name_='python-programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('python-programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2334,6 +2378,9 @@ class java_programmer(programmer): else: return False def export(self, outfile, level, namespace_='', name_='java-programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('java-programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2506,6 +2553,9 @@ class agent(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='agent', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('agent') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2690,6 +2740,9 @@ class special_agent(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='special-agent', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('special-agent') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2907,6 +2960,9 @@ class booster(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='booster', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('booster') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -3144,6 +3200,9 @@ class info(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='info', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('info') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -3305,6 +3364,9 @@ class client_handlerType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='client-handlerType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('client-handlerType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/people_procincl1_sup.py b/tests/people_procincl1_sup.py index 6898534..b592f81 100644 --- a/tests/people_procincl1_sup.py +++ b/tests/people_procincl1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -755,6 +781,9 @@ class people(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='people', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('people') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -897,6 +926,9 @@ class comments(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='comments', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('comments') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1051,6 +1083,9 @@ class person(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='person', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('person') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1208,6 +1243,9 @@ class specialperson(person): else: return False def export(self, outfile, level, namespace_='', name_='specialperson', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('specialperson') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1300,6 +1338,9 @@ class param(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='param', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('param') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1433,6 +1474,9 @@ class agent(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='agent', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('agent') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1570,6 +1614,9 @@ class special_agent(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='special-agent', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('special-agent') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1721,6 +1768,9 @@ class booster(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='booster', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('booster') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1866,6 +1916,9 @@ class info(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='info', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('info') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1958,6 +2011,9 @@ class vehicle(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='vehicle', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('vehicle') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2045,6 +2101,9 @@ class automobile(vehicle): else: return False def export(self, outfile, level, namespace_='', name_='automobile', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('automobile') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2123,6 +2182,9 @@ class airplane(vehicle): else: return False def export(self, outfile, level, namespace_='', name_='airplane', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('airplane') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2297,6 +2359,9 @@ class programmer(person): else: return False def export(self, outfile, level, namespace_='', name_='programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2556,6 +2621,9 @@ class client_handlerType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='client-handlerType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('client-handlerType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2654,6 +2722,9 @@ class java_programmer(programmer): else: return False def export(self, outfile, level, namespace_='', name_='java-programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('java-programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2752,6 +2823,9 @@ class python_programmer(programmer): else: return False def export(self, outfile, level, namespace_='', name_='python-programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('python-programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/prefix_classname1_sup.py b/tests/prefix_classname1_sup.py index e0fa52d..0c4fe6c 100644 --- a/tests/prefix_classname1_sup.py +++ b/tests/prefix_classname1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -743,6 +769,9 @@ class tomato_people(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='people', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('people') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -867,6 +896,9 @@ class tomato_comments(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='comments', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('comments') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1013,6 +1045,9 @@ class tomato_person(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='person', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('person') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1278,6 +1313,9 @@ class tomato_programmer(tomato_person): else: return False def export(self, outfile, level, namespace_='', name_='programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1565,6 +1603,9 @@ class tomato_param(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='param', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('param') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1678,6 +1719,9 @@ class tomato_python_programmer(tomato_programmer): else: return False def export(self, outfile, level, namespace_='', name_='python-programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('python-programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1771,6 +1815,9 @@ class tomato_java_programmer(tomato_programmer): else: return False def export(self, outfile, level, namespace_='', name_='java-programmer', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('java-programmer') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1876,6 +1923,9 @@ class tomato_agent(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='agent', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('agent') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1990,6 +2040,9 @@ class tomato_special_agent(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='special-agent', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('special-agent') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2137,6 +2190,9 @@ class tomato_booster(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='booster', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('booster') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2277,6 +2333,9 @@ class tomato_info(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='info', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('info') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -2371,6 +2430,9 @@ class tomato_client_handlerType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='client-handlerType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('client-handlerType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/recursive_simpletype1_sup.py b/tests/recursive_simpletype1_sup.py index b4201cf..d9ed0d7 100644 --- a/tests/recursive_simpletype1_sup.py +++ b/tests/recursive_simpletype1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -703,6 +729,9 @@ class PersonType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='PersonType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('PersonType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/reference_simpletype1_sup.py b/tests/reference_simpletype1_sup.py index 6b00823..15f6908 100644 --- a/tests/reference_simpletype1_sup.py +++ b/tests/reference_simpletype1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -707,6 +733,9 @@ class dummy(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='dummy', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('dummy') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/rem_dup_elems1_sup.py b/tests/rem_dup_elems1_sup.py index 3740da7..a5fe933 100644 --- a/tests/rem_dup_elems1_sup.py +++ b/tests/rem_dup_elems1_sup.py @@ -56,7 +56,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -711,6 +737,9 @@ class authorsType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='authorsType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('authorsType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -792,6 +821,9 @@ class author(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='author', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('author') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/simplecontent_restriction1_sup.py b/tests/simplecontent_restriction1_sup.py index 1533d86..c532b53 100644 --- a/tests/simplecontent_restriction1_sup.py +++ b/tests/simplecontent_restriction1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -724,6 +750,9 @@ class IdentifierType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='IdentifierType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('IdentifierType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -847,6 +876,9 @@ class BillOfResourcesIDType(IdentifierType): else: return False def export(self, outfile, level, namespace_='', name_='BillOfResourcesIDType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('BillOfResourcesIDType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -916,6 +948,9 @@ class BillOfMaterialIDType(IdentifierType): else: return False def export(self, outfile, level, namespace_='', name_='BillOfMaterialIDType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('BillOfMaterialIDType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/simpletype_memberspecs1_sup.py b/tests/simpletype_memberspecs1_sup.py index 1aa4264..6d445a1 100644 --- a/tests/simpletype_memberspecs1_sup.py +++ b/tests/simpletype_memberspecs1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -697,6 +723,9 @@ class SpecialDate(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='pl:', name_='SpecialDate', namespacedef_='xmlns:pl="http://kuhlman.com/people.xsd"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('SpecialDate') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -772,6 +801,9 @@ class ExtremeDate(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='pl:', name_='ExtremeDate', namespacedef_='xmlns:pl="http://kuhlman.com/people.xsd"', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('ExtremeDate') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/simpletypes_other1_sup.py b/tests/simpletypes_other1_sup.py index 0c55d98..0b60027 100644 --- a/tests/simpletypes_other1_sup.py +++ b/tests/simpletypes_other1_sup.py @@ -55,7 +55,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -699,6 +725,9 @@ class simpleTypeTestsType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleTypeTestsType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleTypeTestsType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -929,6 +958,9 @@ class simpleTypeTestDefs(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleTypeTestDefs', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleTypeTestDefs') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/to_etree1_sup.py b/tests/to_etree1_sup.py index 347dcdc..016d5f5 100644 --- a/tests/to_etree1_sup.py +++ b/tests/to_etree1_sup.py @@ -57,7 +57,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class diff --git a/tests/validate_simpletypes1_sup.py b/tests/validate_simpletypes1_sup.py index bef973b..6d42d6a 100644 --- a/tests/validate_simpletypes1_sup.py +++ b/tests/validate_simpletypes1_sup.py @@ -54,7 +54,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -742,6 +768,9 @@ class containerType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='containerType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('containerType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1150,6 +1179,9 @@ class simpleOneType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleOneType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleOneType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1457,6 +1489,9 @@ class simpleTwoType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleTwoType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleTwoType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1539,6 +1574,9 @@ class simpleTwoElementOneType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleTwoElementOneType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleTwoElementOneType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tests/validate_simpletypes1_warnings.txt b/tests/validate_simpletypes1_warnings.txt index ff17979..04097a2 100644 --- a/tests/validate_simpletypes1_warnings.txt +++ b/tests/validate_simpletypes1_warnings.txt @@ -1,60 +1,60 @@ -tests/validate_simpletypes2_sup.py:993: UserWarning: Value "2" does not match xsd minExclusive restriction on integer_range_1_st +tests/validate_simpletypes2_sup.py:1022: UserWarning: Value "2" does not match xsd minExclusive restriction on integer_range_1_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on integer_range_1_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1003: UserWarning: Value "mmaaa1234mnopzzz" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] +tests/validate_simpletypes2_sup.py:1032: UserWarning: Value "mmaaa1234mnopzzz" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pattern_st_patterns_, )) -tests/validate_simpletypes2_sup.py:1016: UserWarning: Value "floatxx" does not match xsd enumeration restriction on token_enum_st +tests/validate_simpletypes2_sup.py:1045: UserWarning: Value "floatxx" does not match xsd enumeration restriction on token_enum_st warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on token_enum_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1023: UserWarning: Value "22" does not match xsd maxInclusive restriction on integer_range_incl_st +tests/validate_simpletypes2_sup.py:1052: UserWarning: Value "22" does not match xsd maxInclusive restriction on integer_range_incl_st warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on integer_range_incl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1028: UserWarning: Value "-40" does not match xsd minExclusive restriction on integer_range_excl_st +tests/validate_simpletypes2_sup.py:1057: UserWarning: Value "-40" does not match xsd minExclusive restriction on integer_range_excl_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on integer_range_excl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1037: UserWarning: Value "mno pqr" does not match xsd minLength restriction on min_max_length_st +tests/validate_simpletypes2_sup.py:1066: UserWarning: Value "mno pqr" does not match xsd minLength restriction on min_max_length_st warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on min_max_length_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1042: UserWarning: Value "012345" does not match xsd length restriction on length_st +tests/validate_simpletypes2_sup.py:1071: UserWarning: Value "012345" does not match xsd length restriction on length_st warnings_.warn('Value "%(value)s" does not match xsd length restriction on length_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1119: UserWarning: Value "0.2" does not match xsd minInclusive restriction on anonymous_float_valueType +tests/validate_simpletypes2_sup.py:1148: UserWarning: Value "0.2" does not match xsd minInclusive restriction on anonymous_float_valueType warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on anonymous_float_valueType' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1113: UserWarning: Value "efgh" does not match xsd pattern restrictions: [['^abcd$|^ef\\|gh$']] +tests/validate_simpletypes2_sup.py:1142: UserWarning: Value "efgh" does not match xsd pattern restrictions: [['^abcd$|^ef\\|gh$']] warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_vbar_pattern_st_patterns_, )) -tests/validate_simpletypes2_sup.py:995: UserWarning: Value "9" does not match xsd maxExclusive restriction on integer_range_1_st +tests/validate_simpletypes2_sup.py:1024: UserWarning: Value "9" does not match xsd maxExclusive restriction on integer_range_1_st warnings_.warn('Value "%(value)s" does not match xsd maxExclusive restriction on integer_range_1_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1003: UserWarning: Value "aaa1234mnopzzzbcd" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] +tests/validate_simpletypes2_sup.py:1032: UserWarning: Value "aaa1234mnopzzzbcd" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pattern_st_patterns_, )) -tests/validate_simpletypes2_sup.py:1021: UserWarning: Value "-50" does not match xsd minInclusive restriction on integer_range_incl_st +tests/validate_simpletypes2_sup.py:1050: UserWarning: Value "-50" does not match xsd minInclusive restriction on integer_range_incl_st warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on integer_range_incl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1035: UserWarning: Value "asdf asdf asdf asdf asdf asdf" does not match xsd maxLength restriction on min_max_length_st +tests/validate_simpletypes2_sup.py:1064: UserWarning: Value "asdf asdf asdf asdf asdf asdf" does not match xsd maxLength restriction on min_max_length_st warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on min_max_length_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1042: UserWarning: Value "01234567890" does not match xsd length restriction on length_st +tests/validate_simpletypes2_sup.py:1071: UserWarning: Value "01234567890" does not match xsd length restriction on length_st warnings_.warn('Value "%(value)s" does not match xsd length restriction on length_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1052: UserWarning: Value "2015-05-01" does not match xsd minInclusive restriction on date_minincl_st +tests/validate_simpletypes2_sup.py:1081: UserWarning: Value "2015-05-01" does not match xsd minInclusive restriction on date_minincl_st warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on date_minincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1057: UserWarning: Value "2015-11-01" does not match xsd maxInclusive restriction on date_maxincl_st +tests/validate_simpletypes2_sup.py:1086: UserWarning: Value "2015-11-01" does not match xsd maxInclusive restriction on date_maxincl_st warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on date_maxincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1062: UserWarning: Value "2015-05-01" does not match xsd minExclusive restriction on date_minexcl_st +tests/validate_simpletypes2_sup.py:1091: UserWarning: Value "2015-05-01" does not match xsd minExclusive restriction on date_minexcl_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on date_minexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1067: UserWarning: Value "2015-11-01" does not match xsd maxExclusive restriction on date_maxexcl_st +tests/validate_simpletypes2_sup.py:1096: UserWarning: Value "2015-11-01" does not match xsd maxExclusive restriction on date_maxexcl_st warnings_.warn('Value "%(value)s" does not match xsd maxExclusive restriction on date_maxexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1072: UserWarning: Value "13:30:00" does not match xsd minInclusive restriction on time_minincl_st +tests/validate_simpletypes2_sup.py:1101: UserWarning: Value "13:30:00" does not match xsd minInclusive restriction on time_minincl_st warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on time_minincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1077: UserWarning: Value "17:00:00" does not match xsd maxInclusive restriction on time_maxincl_st +tests/validate_simpletypes2_sup.py:1106: UserWarning: Value "17:00:00" does not match xsd maxInclusive restriction on time_maxincl_st warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on time_maxincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1082: UserWarning: Value "13:30:00" does not match xsd minExclusive restriction on time_minexcl_st +tests/validate_simpletypes2_sup.py:1111: UserWarning: Value "13:30:00" does not match xsd minExclusive restriction on time_minexcl_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on time_minexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1087: UserWarning: Value "17:00:00" does not match xsd maxExclusive restriction on time_maxexcl_st +tests/validate_simpletypes2_sup.py:1116: UserWarning: Value "17:00:00" does not match xsd maxExclusive restriction on time_maxexcl_st warnings_.warn('Value "%(value)s" does not match xsd maxExclusive restriction on time_maxexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1092: UserWarning: Value "2015-06-01 13:20:10" does not match xsd minInclusive restriction on datetime_minincl_st +tests/validate_simpletypes2_sup.py:1121: UserWarning: Value "2015-06-01 13:20:10" does not match xsd minInclusive restriction on datetime_minincl_st warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on datetime_minincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1097: UserWarning: Value "2015-11-01 14:20:10" does not match xsd maxInclusive restriction on datetime_maxincl_st +tests/validate_simpletypes2_sup.py:1126: UserWarning: Value "2015-11-01 14:20:10" does not match xsd maxInclusive restriction on datetime_maxincl_st warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on datetime_maxincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1102: UserWarning: Value "2015-06-01 13:20:10" does not match xsd minExclusive restriction on datetime_minexcl_st +tests/validate_simpletypes2_sup.py:1131: UserWarning: Value "2015-06-01 13:20:10" does not match xsd minExclusive restriction on datetime_minexcl_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on datetime_minexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1107: UserWarning: Value "2015-11-01 14:20:10" does not match xsd maxExclusive restriction on datetime_maxexcl_st +tests/validate_simpletypes2_sup.py:1136: UserWarning: Value "2015-11-01 14:20:10" does not match xsd maxExclusive restriction on datetime_maxexcl_st warnings_.warn('Value "%(value)s" does not match xsd maxExclusive restriction on datetime_maxexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1121: UserWarning: Value "6.6" does not match xsd maxInclusive restriction on anonymous_float_valueType +tests/validate_simpletypes2_sup.py:1150: UserWarning: Value "6.6" does not match xsd maxInclusive restriction on anonymous_float_valueType warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on anonymous_float_valueType' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1000: UserWarning: Value "aaa12zzz" does not match xsd minLength restriction on pattern_st +tests/validate_simpletypes2_sup.py:1029: UserWarning: Value "aaa12zzz" does not match xsd minLength restriction on pattern_st warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on pattern_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1003: UserWarning: Value "aaa12zzz" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] +tests/validate_simpletypes2_sup.py:1032: UserWarning: Value "aaa12zzz" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pattern_st_patterns_, )) -tests/validate_simpletypes2_sup.py:1533: UserWarning: Value "pqrst" does not match xsd minLength restriction on simpleTwoElementTwoType +tests/validate_simpletypes2_sup.py:1568: UserWarning: Value "pqrst" does not match xsd minLength restriction on simpleTwoElementTwoType warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on simpleTwoElementTwoType' % {"value" : value.encode("utf-8")} ) diff --git a/tests/validate_simpletypes2_sup.py b/tests/validate_simpletypes2_sup.py index bef973b..6d42d6a 100644 --- a/tests/validate_simpletypes2_sup.py +++ b/tests/validate_simpletypes2_sup.py @@ -54,7 +54,33 @@ def parsexml_(infile, parser=None, **kwargs): return doc # -# User methods +# Namespace prefix definition table (and other attributes, too) +# +# The module generatedsnamespaces, if it is importable, must contain +# a dictionary named GeneratedsNamespaceDefs. This Python dictionary +# should map element type names (strings) to XML schema namespace prefix +# definitions. The export method for any class for which there is +# a namespace prefix definition, will export that definition in the +# XML representation of that element. See the export method of +# any generated element type class for a example of the use of this +# table. +# A sample table is: +# +# # File: generatedsnamespaces.py +# +# GenerateDSNamespaceDefs = { +# "ElementtypeA": "http://www.xxx.com/namespaceA", +# "ElementtypeB": "http://www.xxx.com/namespaceB", +# } +# + +try: + from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ +except ImportError: + GenerateDSNamespaceDefs_ = {} + +# +# The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class @@ -742,6 +768,9 @@ class containerType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='containerType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('containerType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1150,6 +1179,9 @@ class simpleOneType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleOneType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleOneType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1457,6 +1489,9 @@ class simpleTwoType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleTwoType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleTwoType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: @@ -1539,6 +1574,9 @@ class simpleTwoElementOneType(GeneratedsSuper): else: return False def export(self, outfile, level, namespace_='', name_='simpleTwoElementOneType', namespacedef_='', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleTwoElementOneType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: diff --git a/tutorial/generateds_tutorial.html b/tutorial/generateds_tutorial.html index 4ee1307..48cc09d 100644 --- a/tutorial/generateds_tutorial.html +++ b/tutorial/generateds_tutorial.html @@ -219,7 +219,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.26a</td> +<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.27a</td> </tr> </tbody> </table> @@ -228,7 +228,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">May 09, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">June 01, 2017</td> </tr> </tbody> </table> @@ -1210,7 +1210,7 @@ named <tt class="docutils literal">garden_api.py</tt>, you can create an instanc <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateds_tutorial.txt">View document source</a>. -Generated on: 2017-05-09 21:57 UTC. +Generated on: 2017-06-01 16:00 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/tutorial/generateds_tutorial.txt b/tutorial/generateds_tutorial.txt index ec5b5db..7bab582 100644 --- a/tutorial/generateds_tutorial.txt +++ b/tutorial/generateds_tutorial.txt @@ -11,7 +11,7 @@ generateDS -- Introduction and Tutorial .. version -:revision: 2.26a +:revision: 2.27a .. version diff --git a/tutorial/generateds_tutorial.zip b/tutorial/generateds_tutorial.zip index 490a139bad4144c6118c1b4a99694371778130b9..6790559d1746dd3a640a3c64508389e1abded303 100644 GIT binary patch delta 11970 zcmV;zE<MqJ{Q~{`0v%9G0|XQR000O8S8=~eZ<gz+TLJ(84g~-J7XTcSkhvOv2>=6C zF)vxVH7{9pcnbgl1n2_*00ig*005m+O>5jR5WV|X%q5V8tTrrxf+3f7FQEw(nnQc) zYNhd7RMr?t&c=`*-x+zG4<CAnE|y0#PjB8l-QIp?RYwdMb;jLKSg+wO<Vbcf*--!; zEIbaGqSL<m6#8vd)q2P+#Ts^h`U&Ct(E3gXj#?Wrr5fztDFl}~ufTHBYrqmmC>|@| z)#lvSo6YHTQty(K99K%gjv!Emj;w1&$Sp!c-qXp2BRpYD(vP98!;q5_z{eIx&=Fxs zXyGuz&|8+_oU8g#72NYb_Yv{Q$+m{A+J4cCQ>m@tMLsX(Xxc)F*KqNF6)x-*T>P#$ z*HA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MDAxLsSKu9{7Td*c~(}6v^ z2q1&ONnP5IGvM<sT>zOK*rW#&tZ0V_HtiMzNZbF{ZSR(YYyv~}7(v2-jeGO}Az}Xw z&-X|J5W@d!GW03{2LHEt6^;l_?G=NR1+VrRLaC)ffbCNW!GLZ&uuUHdtXb!OP<4p^ E1&oZO`~Uy| diff --git a/updateversion.py b/updateversion.py index 0ec2618..1ded139 100755 --- a/updateversion.py +++ b/updateversion.py @@ -16,6 +16,7 @@ Example: # # Imports +from __future__ import print_function import sys import getopt import re @@ -71,7 +72,7 @@ def updateversion(version): for spec in REPL_SPEC: targetfilename = spec['filename'] if VERBOSE: - print 'updating: "%s"' % (targetfilename, ) + print('updating: "%s"' % (targetfilename, )) targetfile = open(targetfilename, 'r') content = targetfile.read() targetfile.close() @@ -100,7 +101,7 @@ def update1file(targetfilename, content): def replfuncmaker(version): def replfunc(matchobj): if VERBOSE: - print '(replfunc) matchobj.groups()', matchobj.groups() + print('(replfunc) matchobj.groups()', matchobj.groups()) return matchobj.group(1) + version + matchobj.group(3) return replfunc @@ -109,7 +110,7 @@ USAGE_TEXT = __doc__ def usage(): - print USAGE_TEXT + print(USAGE_TEXT) sys.exit(1) diff --git a/utils/README.txt b/utils/README.txt new file mode 100644 index 0000000..5629497 --- /dev/null +++ b/utils/README.txt @@ -0,0 +1,110 @@ +=================================== +Utility scripts for generateDS.py +=================================== + +This document provides an explanation of and instructions on the use +of several utilities that are in this subdirectory and that preform +helpful tasks related to ``generateDS.py``. + +Note that these utility scripts do not install automatically. You +can find them in the ``generateds/utirs`` directory; and you can +either copy them to some directory on your path or create a +(symbolic) link to them from some directory on your path. + + +show_schema_hierarchy.py +========================== + +XML schemas often import other schemas which import still other +schemas etc. to an arbitrary depth. If you feel it might be helpful +to learn which schemas are being imported by your schema and +recursively which schema *they* import, then this utility might be +helpful. + +Run ``python show_schema_hierarchy.py --help`` for usage notes. + + +collect_schema_locations.py +============================= + +This utility scans the top level schema and produces a JSON file +containing directives. This directives file can be used by +``batch_generate.py`` to run ``generateDS.py`` to generate a module +for each of the schema references that is extracted. + +Run ``python collect_schema_locations.py --help`` for usage notes. +There are some notes in the ``generateDS.py`` documentation. + +Here is a sample of the directives file that is produced:: + + { + "directives": [ + { + "schema": "DtsInstrumentBox.xsd", + "outfile": "DtsInstrumentBox.py", + "outsubfile": "", + "flags": "" + }, + { + "schema": "ProdmlCommon.xsd", + "outfile": "ProdmlCommon.py", + "outsubfile": "", + "flags": "-f --member-specs=list --no-namespace-defs" + }, + { + "schema": "FiberOpticalPath.xsd", + "outfile": "FiberOpticalPath.py", + "outsubfile": "", + "flags": "" + } + ] + } + + +batch_generate.py +=================== + +``batch_generate.py`` runs ``generateDS.py`` to do batch generation +of multiple modules. ``batch_generate.py`` determines which modules +to generate from which schemas by reading directives from a JSON +file. + +Run ``python batch_generate.py --help`` for usage notes. And, there +are a few notes in the ``generateDS.py`` documentation. + + +The directive file +-------------------- + +The directives file can be produced by running +``collect_schema_locations.py``, or it can be written by hand. + +You can also add command line options to the "flags" entries and can +add the name of sub-class modules to be generated to the +"outsubfile" entries. + +Comments in the directives file -- The directives file is a JSON +file, and JSON does not support comments. However, for use with +``batch_generate.py``, the input directives file can contain +comments. Any line whose first non-whitespace characters are "//" +is considered a comment and is discarded by ``batch_generate.py`` +before the remaining contents are parsed by the JSON parser. + +See the notes in this file on ``collect_schema_locations.py`` for a +sample of the directives file. + + +Options and configuration +--------------------------- + +Each of the long-name command line options (the ones preceded by +"--", excluding ``--config``) can be placed in a configuration file +and referenced with the ``--config`` command line option. Here is a +sample of a configuration file:: + + [generateds-batch] + verbose = true + command = ./generateDS.py + flags = -f --member-specs=dict + in-path = energistics/prodml/v2.0/xsd_schemas + out-path = OnePer3 diff --git a/utils/batch_generate.py b/utils/batch_generate.py new file mode 100755 index 0000000..d8f955d --- /dev/null +++ b/utils/batch_generate.py @@ -0,0 +1,243 @@ +#!/usr/bin/env python + +""" +usage: batch_generate.py [-h] [--config CONFIG] [-c COMMAND] [--flags FLAGS] + [--in-path IN_PATH] [--out-path OUT_PATH] [-v] + infilename + +synopsis: + read input directives from JSON file (produced by + collect_schema_locations.py) and generate python modules. + +positional arguments: + infilename input JSON file containing directives + +optional arguments: + -h, --help show this help message and exit + --config CONFIG configuration file + -c COMMAND, --command COMMAND + command. Default is "generateDS.py" + --flags FLAGS command line options for generateDS.py + --in-path IN_PATH path to the directory containing the input schemas + --out-path OUT_PATH path to a directory into which modules should be + generated + -v, --verbose Print messages during actions. + +examples: + python batch_generate.py input_directives.json + python batch_generate.py --config=name.config input_directives.json + +notes: + The configuration file (see --config) has the following form: + + [generateds] + verbose = true + command = ./generateDS.py + flags = -f --member-specs=dict + in-path = energistics/prodml/v2.0/xsd_schemas + out-path = OnePer + + The option names in this configuration file are the long command line + option names. Options entered on the command line over-ride options + in this config file. + Flags/options for generateDS.py -- These flags are passed to + generateDS.py as command line options. Precedence: (1) Flags in + the directives file override the --flags command line option to + batch_generate.py. (2) Flags in the --flags command line option + to batch_generate.py override flags in the configuration file (the + argument to --config=). +""" + + +# +# imports +from __future__ import print_function +import os +import argparse +import configparser +import subprocess +import json + + +# +# Global variables + + +# +# Private functions + +def dbg_msg(options, msg): + """Print a message if verbose is on.""" + if options.verbose: + print(msg) + + +def generate_one(directive, options): + """Generate modules for one XML schema.""" + schema_name = directive.get('schema') + outfilename = directive.get('outfile') + outsubfilename = directive.get('outsubfile') + if options.in_path: + schema_name = os.path.join(options.in_path, schema_name) + modulename = outfilename.split('.')[0] + if options.out_path: + outfilename = os.path.join(options.out_path, outfilename) + if outsubfilename: + if options.out_path: + outsubfilename = os.path.join(options.out_path, outsubfilename) + outsubfilestem = outsubfilename + outsubfilename = '--super={} -s {}'.format(modulename, outsubfilename) + else: + outsubfilename = "" + outsubfilestem = outsubfilename + flags = directive.get('flags') + if not flags: + flags = options.flags + #flags = '{} {}'.format(flags, options.flags) + cmd = '{} {} -o {} {} {}'.format( + options.command, + flags, + outfilename, + outsubfilename, + schema_name, + ) + dbg_msg(options, '\ncmd: {}'.format(cmd)) + result = subprocess.run( + cmd, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + shell=True, + ) + dbg_msg(options, 'generated: {} {}'.format(outfilename, outsubfilestem)) + if result.stderr: + print('errors: {}'.format(result.stderr)) + if result.stdout: + print('output: {}'.format(result.stdout)) + + +def merge_options(options): + """Merge config file options and command line options. + Command line options over-ride config file options. + """ + config = configparser.ConfigParser() + config.read(options.config) + if not config.has_section('generateds-batch'): + raise RuntimeError( + 'config file missing required section "generateds-batch"') + section = config['generateds-batch'] + for key in section: + key1 = key.replace('-', '_') + if not getattr(options, key1): + setattr(options, key1, section[key]) + + +def load_json_file(infile): + """Read file. Strip out lines that begin with '//'.""" + lines = [] + for line in infile: + if not line.lstrip().startswith('//'): + lines.append(line) + content = ''.join(lines) + return content + + +# +# Exported functions +def batch_generate(infile, options): + """Generate module(s) for each line in directives file.""" + content = load_json_file(infile) + specification = json.loads(content) + directives = specification['directives'] + for directive in directives: + generate_one(directive, options) + + +def main(): + description = """\ +synopsis: + read input directives from JSON file (produced by + collect_schema_locations.py) and generate python modules. +""" + epilog = """\ +examples: + python batch_generate.py input_directives.json + python batch_generate.py --config=name.config input_directives.json + +notes: + The input directives file is a JSON file. batch_generate.py will + run generateDS.py once for each directive in this JSON file. + This directives file can be produced by + utils/collect_schema_locations.py. + The configuration file (see --config) has the following form: + + [generateds] + verbose = true + command = ./generateDS.py + flags = -f --member-specs=dict + in-path = energistics/prodml/v2.0/xsd_schemas + out-path = OnePer + + The option names in this configuration file are the long command line + option names. Options entered on the command line over-ride options + in this config file. + Flags/options for generateDS.py -- These flags are passed to + generateDS.py as command line options. Precedence: (1) Flags in + the directives file override the --flags command line option to + batch_generate.py. (2) Flags in the --flags command line option + to batch_generate.py override flags in the configuration file (the + argument to --config=). + The input directives file can contain comments. Any line whose first + non-whitespace characters are "//" is considered a comment and is + discarded before the remaining contents are parsed by the JSON parser. +""" + parser = argparse.ArgumentParser( + description=description, + epilog=epilog, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + parser.add_argument( + "infilename", + help="input JSON file containing directives", + ) + parser.add_argument( + "--config", + help="configuration file", + ) + parser.add_argument( + "-c", "--command", + #default="generateDS.py", + help="command. Default is \"generateDS.py\"", + ) + parser.add_argument( + "--flags", + help="command line options for generateDS.py", + ) + parser.add_argument( + "--in-path", + help="path to the directory containing the input schemas", + ) + parser.add_argument( + "--out-path", + help="path to a directory into which modules should be generated", + ) + parser.add_argument( + "-v", "--verbose", + action="store_true", + help="Print messages during actions.", + ) + options = parser.parse_args() + if options.config: + merge_options(options) + if not options.command: + options.command = 'generateDS.py' + if not options.flags: + options.flags = '' + dbg_msg(options, '\noptions: {}'.format(options)) + infile = open(options.infilename, 'r') + batch_generate(infile, options) + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + #import ipdb; ipdb.set_trace() + main() diff --git a/utils/collect_schema_locations.py b/utils/collect_schema_locations.py new file mode 100755 index 0000000..228410d --- /dev/null +++ b/utils/collect_schema_locations.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python + +""" +usage: collect_schema_locations.py [-h] [-f] [-v] infilename [outfilename] + +synopsis: + collect schema locations from xs:include/xs:import elements in schema. + +positional arguments: + infilename name/location of the XML schema file to be searched + outfilename output file name; if ommited stdout + +optional arguments: + -h, --help show this help message and exit + -f, --force force overwrite existing output file + -v, --verbose print messages during actions. + +examples: + python collect_schema_locations.py myschema.xsd + python collect_schema_locations.py myschema.xsd outfile.txt +""" + + +# +# imports +from __future__ import print_function +import sys +import os +import argparse +import json +from lxml import etree + + +# +# Global variables + + +# +# Private functions + +def dbg_msg(options, msg): + """Print a message if verbose is on.""" + if options.verbose: + print(msg) + + +def extract_locations(infile, options): + doc = etree.parse(infile) + root = doc.getroot() + elements = root.xpath( + './/xs:include', + namespaces=root.nsmap, + ) + locations = [] + for element in elements: + schema_name = element.get('schemaLocation') + locations.append(schema_name) + return locations + + +def generate(locations, outfile, options): + directives = [] + for location in locations: + schema_name = location + outfilename = os.path.split(schema_name)[1] + outfilename = os.path.splitext(outfilename)[0] + outfilename = '{}.py'.format(outfilename) + directive = { + 'schema': schema_name, + 'outfile': outfilename, + 'outsubfile': '', + 'flags': '', + } + directives.append(directive) + return directives + + +def make_output_file(outfilename, options): + if os.path.exists(outfilename) and not options.force: + sys.exit("\noutput file exists. Use -f/--force to over-write.\n") + outfile = open(outfilename, 'w') + return outfile + + +# +# Exported functions + +def extract_and_generate(infile, outfile, options): + locations = extract_locations(infile, options) + directives = generate(locations, outfile, options) + specification = { + 'directives': directives, + } + json.dump(specification, outfile, indent=' ') + + +def main(): + description = """\ +synopsis: + collect schema locations from xs:include/xs:import elements in schema. +""" + epilog = """\ +examples: + python collect_schema_locations.py myschema.xsd + python collect_schema_locations.py myschema.xsd outfile.txt + +notes: + The output directives file is a JSON file suitable for input to + utils/batch_generate.py. This directives file contains one directive + for each module to be generated by generateDS.py. + You can edit this resulting JSON file, for example to add a sub-class + module file or flags/options for generateDS.py that are specific + to each directive. +""" + parser = argparse.ArgumentParser( + description=description, + epilog=epilog, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + parser.add_argument( + "infilename", + help="name/location of the XML schema file to be searched" + ) + parser.add_argument( + "outfilename", + nargs="?", + default=None, + help="output file name; if ommited stdout" + ) + parser.add_argument( + "-f", "--force", + action="store_true", + help="force overwrite existing output file", + ) + parser.add_argument( + "-v", "--verbose", + action="store_true", + help="print messages during actions.", + ) + options = parser.parse_args() + infile = open(options.infilename, 'r') + if options.outfilename: + outfile = make_output_file(options.outfilename, options) + else: + outfile = sys.stdout + extract_and_generate(infile, outfile, options) + infile.close() + if options.outfilename: + outfile.close() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + #import ipdb; ipdb.set_trace() + main() diff --git a/utils/show_schema_hierarchy.py b/utils/show_schema_hierarchy.py new file mode 100755 index 0000000..83afb97 --- /dev/null +++ b/utils/show_schema_hierarchy.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python + +""" +usage: show_schema_hierarchy.py [-h] [-i INDENT] [--eliminate-branch-dups] + [--show-loop-references] [-v] + inschema + +synopsis: + show an indented schema hierarchy of xs:include/xs:import. + +positional arguments: + inschema The input (root) schema + +optional arguments: + -h, --help show this help message and exit + -i INDENT, --indent INDENT + Indent string. default: " " (4 spaces) + --eliminate-branch-dups + Eliminate (ignore) duplicate references even when + previously seen in other branches + --show-loop-references + Show references that would cause loops + -v, --verbose Print messages during actions. + +examples: + python show_schema_hierarchy.py root_schema.xsd +""" + + +# +# imports +from __future__ import print_function +#import sys +import argparse +from lxml import etree + + +# +# Global variables + + +# +# Private functions + +def dbg_msg(options, msg): + """Print a message if verbose is on.""" + if options.verbose: + print(msg) + + +# +# Exported functions + + +def show_hierarchy(inschema, path, indent, namespaces, previous, options): + if not inschema.startswith('http') and path: + inschemaloc = '{}/{}'.format(path, inschema) + else: + inschemaloc = inschema + if inschema in previous: + if options.show_loop_references: + print('{}*loop* -- {}'.format(indent, inschemaloc)) + #print('{} *previous* -- {}'.format(indent, previous)) + return + previous.add(inschema) + print('{}{} -- {}'.format(indent, inschema, inschemaloc)) + doc = etree.parse(inschemaloc) + root = doc.getroot() + elements = root.xpath('./xs:include', namespaces=namespaces) + elements += root.xpath('./xs:import', namespaces=namespaces) + indent1 = indent + options.indent + if inschema.startswith('http'): + stem = inschema.split('/')[-1] + ln = 0 - (len(stem) + 1) + path = inschema[:ln] + for element in elements: + location = element.get('schemaLocation') + if options.eliminate_branch_dups: + previous1 = previous + else: + previous1 = previous.copy() + show_hierarchy(location, path, indent1, namespaces, previous1, options) + + +def main(): + description = """\ +synopsis: + show an indented schema hierarchy of schema documents that are + pulled in by xs:include and xs:import. +""" + epilog = """\ +examples: + python show_schema_hierarchy.py root_schema.xsd + python show_schema_hierarchy.py -v --show-loop-references root_schema.xsd +""" + parser = argparse.ArgumentParser( + description=description, + epilog=epilog, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + parser.add_argument( + "inschema", + help="the input (root) schema", + ) + parser.add_argument( + "-i", "--indent", + default=" ", + help='indent string. default is 4 spaces', + ) + parser.add_argument( + "--eliminate-branch-dups", + action="store_true", + help="eliminate (ignore) duplicate references even when previously " + "seen in other branches", + ) + parser.add_argument( + "--show-loop-references", + action="store_true", + help="show references that would cause loops" + ) + parser.add_argument( + "-v", "--verbose", + action="store_true", + help="print additional messages during actions.", + ) + options = parser.parse_args() + parent = '' + indent = '' + namespaces = {'xs': 'http://www.w3.org/2001/XMLSchema'} + previous = set() + show_hierarchy( + options.inschema, parent, indent, namespaces, previous, options) + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + #import ipdb; ipdb.set_trace() + main() -- GitLab