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

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 112

Show
Ignore:
Timestamp:
10/12/07 11:46:27 (11 months ago)
Author:
callan
Message:

Synchronized with generateDS.py version 1.11a.

Location:
Xml/xsd-fu/trunk/generateDS
Files:
7 modified

  • PKG-INFO (modified) (1 diff)
  • README (modified) (1 diff)
  • generateDS.html (modified) (24 diffs)
  • generateDS.py (modified) (3 diffs)
  • setup.py (modified) (1 diff)
  • tests/out1sub.py (modified) (1 diff)
  • tests/out1sup.py (modified) (2 diffs)

Legend:

Unmodified
Added
Removed
  • Xml/xsd-fu/trunk/generateDS/PKG-INFO

    r111 r112  
    11Metadata-Version: 1.0 
    22Name: generateDS 
    3 Version: 1.10a 
     3Version: 1.11a 
    44Summary: Generation of Python data structures and XML parser from Xschema 
    55Home-page: http://www.rexx.com/~dkuhlman 
  • Xml/xsd-fu/trunk/generateDS/README

    r111 r112  
    140140Change history 
    141141-------------- 
     142 
     143Version 1.11a (10/11/2007) 
     144  * Various added features contributed by Chris Allan.  For more 
     145    information see: 
     146    http://www.rexx.com/~dkuhlman/generateDS.html#additional-features 
    142147 
    143148Version 1.10a (08/21/2007, again) 
  • Xml/xsd-fu/trunk/generateDS/generateDS.html

    r111 r112  
    77<title>generateDS -- Generate Data Structures from XML Schema</title> 
    88<meta name="author" content="Dave Kuhlman" /> 
    9 <meta name="date" content="Aug. 21, 2007" /> 
     9<meta name="date" content="Oct. 11, 2007" /> 
    1010<meta name="copyright" content="Copyright (c) 2004 Dave Kuhlman. This documentation and the software it describes is covered by The MIT License: http://www.opensource.org/licenses/mit-license." /> 
    1111<style type="text/css"> 
    1212 
    13 /* training doc css */ 
     13/* css */ 
    1414 
    1515body { 
    … …  
    8989  font-size: 130%; 
    9090  margin-bottom: 0.5em; 
     91  text-decoration: underline; 
    9192} 
    9293h4 { 
    … …  
    191192</td></tr> 
    192193<tr><th class="docinfo-name">Revision:</th> 
    193 <td>1.10a</td></tr> 
     194<td>1.11a</td></tr> 
    194195<tr><th class="docinfo-name">Date:</th> 
    195 <td>Aug. 21, 2007</td></tr> 
     196<td>Oct. 11, 2007</td></tr> 
    196197<tr><th class="docinfo-name">Copyright:</th> 
    197198<td>Copyright (c) 2004 Dave Kuhlman. This documentation 
    … …  
    258259</ul> 
    259260</li> 
    260 <li><a class="reference internal" href="#how-to-use-the-generated-source-code" id="id36">7&nbsp;&nbsp;&nbsp;How-to Use the Generated Source Code</a><ul class="auto-toc"> 
    261 <li><a class="reference internal" href="#the-parsing-functions" id="id37">7.1&nbsp;&nbsp;&nbsp;The parsing functions</a></li> 
    262 <li><a class="reference internal" href="#the-export-methods" id="id38">7.2&nbsp;&nbsp;&nbsp;The export methods</a><ul class="auto-toc"> 
    263 <li><a class="reference internal" href="#method-export" id="id39">7.2.1&nbsp;&nbsp;&nbsp;Method export</a></li> 
    264 <li><a class="reference internal" href="#method-exportliteral" id="id40">7.2.2&nbsp;&nbsp;&nbsp;Method <tt class="docutils literal"><span class="pre">exportLiteral</span></tt></a><ul class="auto-toc"> 
    265 <li><a class="reference internal" href="#what-it-does" id="id41">7.2.2.1&nbsp;&nbsp;&nbsp;What It Does</a></li> 
    266 <li><a class="reference internal" href="#why-you-might-care" id="id42">7.2.2.2&nbsp;&nbsp;&nbsp;Why You Might Care</a></li> 
    267 <li><a class="reference internal" href="#how-to-use-it" id="id43">7.2.2.3&nbsp;&nbsp;&nbsp;How to use it</a></li> 
    268 </ul> 
    269 </li> 
    270 </ul> 
    271 </li> 
    272 <li><a class="reference internal" href="#building-instances" id="id44">7.3&nbsp;&nbsp;&nbsp;Building instances</a></li> 
    273 <li><a class="reference internal" href="#using-the-subclass-module" id="id45">7.4&nbsp;&nbsp;&nbsp;Using the subclass module</a></li> 
    274 <li><a class="reference internal" href="#elements-with-attributes-but-no-nested-children" id="id46">7.5&nbsp;&nbsp;&nbsp;Elements with attributes but no nested children</a></li> 
    275 <li><a class="reference internal" href="#id3" id="id47">7.6&nbsp;&nbsp;&nbsp;Mixed content</a></li> 
    276 <li><a class="reference internal" href="#id5" id="id48">7.7&nbsp;&nbsp;&nbsp;anyAttribute</a></li> 
    277 <li><a class="reference internal" href="#user-methods" id="id49">7.8&nbsp;&nbsp;&nbsp;User Methods</a></li> 
    278 </ul> 
    279 </li> 
    280 <li><a class="reference internal" href="#how-to-modify-the-generated-code" id="id50">8&nbsp;&nbsp;&nbsp;How-to Modify the Generated Code</a><ul class="auto-toc"> 
    281 <li><a class="reference internal" href="#adding-features-to-class-definitions" id="id51">8.1&nbsp;&nbsp;&nbsp;Adding features to class definitions</a></li> 
    282 </ul> 
    283 </li> 
    284 <li><a class="reference internal" href="#examples-and-demonstrations" id="id52">9&nbsp;&nbsp;&nbsp;Examples and Demonstrations</a></li> 
    285 <li><a class="reference internal" href="#limitations-of-generateds" id="id53">10&nbsp;&nbsp;&nbsp;Limitations of generateDS</a><ul class="auto-toc"> 
    286 <li><a class="reference internal" href="#xml-schema-limitations" id="id54">10.1&nbsp;&nbsp;&nbsp;XML Schema limitations</a></li> 
    287 <li><a class="reference internal" href="#large-documents" id="id55">10.2&nbsp;&nbsp;&nbsp;Large documents</a></li> 
    288 </ul> 
    289 </li> 
    290 <li><a class="reference internal" href="#includes-the-xml-schema-include-element" id="id56">11&nbsp;&nbsp;&nbsp;Includes -- The XML Schema include element</a></li> 
    291 <li><a class="reference internal" href="#see-also" id="id57">12&nbsp;&nbsp;&nbsp;See Also</a></li> 
     261<li><a class="reference internal" href="#additional-features" id="id36">7&nbsp;&nbsp;&nbsp;Additional Features</a><ul class="auto-toc"> 
     262<li><a class="reference internal" href="#xsd-list-element-support" id="id37">7.1&nbsp;&nbsp;&nbsp;xsd:list element support</a></li> 
     263<li><a class="reference internal" href="#xsd-enumeration-support" id="id38">7.2&nbsp;&nbsp;&nbsp;xsd:enumeration support</a></li> 
     264<li><a class="reference internal" href="#xsd-union-support" id="id39">7.3&nbsp;&nbsp;&nbsp;xsd:union support</a></li> 
     265<li><a class="reference internal" href="#extended-xsd-choice-support" id="id40">7.4&nbsp;&nbsp;&nbsp;Extended xsd:choice support</a></li> 
     266<li><a class="reference internal" href="#minoccurs-attribute-support" id="id41">7.5&nbsp;&nbsp;&nbsp;minOccurs attribute support</a></li> 
     267<li><a class="reference internal" href="#more-thorough-content-type-and-base-type-resolution" id="id42">7.6&nbsp;&nbsp;&nbsp;More thorough content type and base type resolution</a></li> 
     268<li><a class="reference internal" href="#making-top-level-simpletypes-available-from-xschemahandler" id="id43">7.7&nbsp;&nbsp;&nbsp;Making top level simpleTypes available from XschemaHandler</a></li> 
     269</ul> 
     270</li> 
     271<li><a class="reference internal" href="#how-to-use-the-generated-source-code" id="id44">8&nbsp;&nbsp;&nbsp;How-to Use the Generated Source Code</a><ul class="auto-toc"> 
     272<li><a class="reference internal" href="#the-parsing-functions" id="id45">8.1&nbsp;&nbsp;&nbsp;The parsing functions</a></li> 
     273<li><a class="reference internal" href="#the-export-methods" id="id46">8.2&nbsp;&nbsp;&nbsp;The export methods</a><ul class="auto-toc"> 
     274<li><a class="reference internal" href="#method-export" id="id47">8.2.1&nbsp;&nbsp;&nbsp;Method export</a></li> 
     275<li><a class="reference internal" href="#method-exportliteral" id="id48">8.2.2&nbsp;&nbsp;&nbsp;Method <tt class="docutils literal"><span class="pre">exportLiteral</span></tt></a><ul class="auto-toc"> 
     276<li><a class="reference internal" href="#what-it-does" id="id49">8.2.2.1&nbsp;&nbsp;&nbsp;What It Does</a></li> 
     277<li><a class="reference internal" href="#why-you-might-care" id="id50">8.2.2.2&nbsp;&nbsp;&nbsp;Why You Might Care</a></li> 
     278<li><a class="reference internal" href="#how-to-use-it" id="id51">8.2.2.3&nbsp;&nbsp;&nbsp;How to use it</a></li> 
     279</ul> 
     280</li> 
     281</ul> 
     282</li> 
     283<li><a class="reference internal" href="#building-instances" id="id52">8.3&nbsp;&nbsp;&nbsp;Building instances</a></li> 
     284<li><a class="reference internal" href="#using-the-subclass-module" id="id53">8.4&nbsp;&nbsp;&nbsp;Using the subclass module</a></li> 
     285<li><a class="reference internal" href="#elements-with-attributes-but-no-nested-children" id="id54">8.5&nbsp;&nbsp;&nbsp;Elements with attributes but no nested children</a></li> 
     286<li><a class="reference internal" href="#id3" id="id55">8.6&nbsp;&nbsp;&nbsp;Mixed content</a></li> 
     287<li><a class="reference internal" href="#id5" id="id56">8.7&nbsp;&nbsp;&nbsp;anyAttribute</a></li> 
     288<li><a class="reference internal" href="#user-methods" id="id57">8.8&nbsp;&nbsp;&nbsp;User Methods</a></li> 
     289</ul> 
     290</li> 
     291<li><a class="reference internal" href="#how-to-modify-the-generated-code" id="id58">9&nbsp;&nbsp;&nbsp;How-to Modify the Generated Code</a><ul class="auto-toc"> 
     292<li><a class="reference internal" href="#adding-features-to-class-definitions" id="id59">9.1&nbsp;&nbsp;&nbsp;Adding features to class definitions</a></li> 
     293</ul> 
     294</li> 
     295<li><a class="reference internal" href="#examples-and-demonstrations" id="id60">10&nbsp;&nbsp;&nbsp;Examples and Demonstrations</a></li> 
     296<li><a class="reference internal" href="#limitations-of-generateds" id="id61">11&nbsp;&nbsp;&nbsp;Limitations of generateDS</a><ul class="auto-toc"> 
     297<li><a class="reference internal" href="#xml-schema-limitations" id="id62">11.1&nbsp;&nbsp;&nbsp;XML Schema limitations</a></li> 
     298<li><a class="reference internal" href="#large-documents" id="id63">11.2&nbsp;&nbsp;&nbsp;Large documents</a></li> 
     299</ul> 
     300</li> 
     301<li><a class="reference internal" href="#includes-the-xml-schema-include-element" id="id64">12&nbsp;&nbsp;&nbsp;Includes -- The XML Schema include element</a></li> 
     302<li><a class="reference internal" href="#acknowledgment" id="id65">13&nbsp;&nbsp;&nbsp;Acknowledgment</a></li> 
     303<li><a class="reference internal" href="#see-also" id="id66">14&nbsp;&nbsp;&nbsp;See Also</a></li> 
    292304</ul> 
    293305</div> 
    … …  
    350362<h2><a class="toc-backref" href="#id8">2.1&nbsp;&nbsp;&nbsp;Download</a></h2> 
    351363<p>You can find the distribution here: 
    352 <a class="reference external" href="http://www.rexx.com/~dkuhlman/generateDS-1.10a.tar.gz">http://www.rexx.com/~dkuhlman/generateDS-1.10a.tar.gz</a></p> 
     364<a class="reference external" href="http://www.rexx.com/~dkuhlman/generateDS-1.11a.tar.gz">http://www.rexx.com/~dkuhlman/generateDS-1.11a.tar.gz</a></p> 
    353365<p>It is also available at SourceForge: 
    354366<a class="reference external" href="http://sourceforge.net/projects/generateds/">http://sourceforge.net/projects/generateds/</a></p> 
    … …  
    11561168</div> 
    11571169</div> 
     1170<div class="section" id="additional-features"> 
     1171<h1><a class="toc-backref" href="#id36">7&nbsp;&nbsp;&nbsp;Additional Features</a></h1> 
     1172<p>Here are additional features, contributed by users such as Chris 
     1173Allan.  Many thanks.</p> 
     1174<div class="section" id="xsd-list-element-support"> 
     1175<h2><a class="toc-backref" href="#id37">7.1&nbsp;&nbsp;&nbsp;xsd:list element support</a></h2> 
     1176<p>xsd:list elements can be used with a child xsd:simpleType which 
     1177confuses the XschemaHandler stack unrolling.  xsd:list element 
     1178support should allow the following XML Schema definition to be 
     1179supported in <tt class="docutils literal"><span class="pre">generateDS.py</span></tt>:</p> 
     1180<pre class="literal-block"> 
     1181&lt;xsd:attribute name=&quot;Foo&quot;&gt; 
     1182    &lt;xsd:simpleType&gt; 
     1183        &lt;xsd:list&gt; 
     1184            &lt;xsd:simpleType&gt; 
     1185                ... 
     1186            &lt;/xsd:simpleType&gt; 
     1187        &lt;/xsd:list&gt; 
     1188    &lt;/xsd:simpleType&gt; 
     1189&lt;/xsd:attribute&gt; 
     1190</pre> 
     1191</div> 
     1192<div class="section" id="xsd-enumeration-support"> 
     1193<h2><a class="toc-backref" href="#id38">7.2&nbsp;&nbsp;&nbsp;xsd:enumeration support</a></h2> 
     1194<p>The enumerated values for the parent element are resolved and made 
     1195available through the instance attribute <tt class="docutils literal"><span class="pre">values</span></tt>.</p> 
     1196</div> 
     1197<div class="section" id="xsd-union-support"> 
     1198<h2><a class="toc-backref" href="#id39">7.3&nbsp;&nbsp;&nbsp;xsd:union support</a></h2> 
     1199<p>In order to properly resolve and query types which are unions in 
     1200an XML Schema, an element's membership in an xsd:union is 
     1201available through the instance attribute <tt class="docutils literal"><span class="pre">unionOf</span></tt>.</p> 
     1202</div> 
     1203<div class="section" id="extended-xsd-choice-support"> 
     1204<h2><a class="toc-backref" href="#id40">7.4&nbsp;&nbsp;&nbsp;Extended xsd:choice support</a></h2> 
     1205<p>When a parent xsd:choice is exists, an element's &quot;maxOccurs&quot; and 
     1206&quot;minOccurs&quot; values can be inherited from the xsd:choice rather 
     1207than the element itself. xsd:choice elements have been added to 
     1208the child element via the <tt class="docutils literal"><span class="pre">choice</span></tt> instance attribute and are 
     1209now used in the &quot;maxOccurs&quot; and &quot;minOccurs&quot; attribute resolution. 
     1210This should allow the following XML Schema definition to be 
     1211supported in <tt class="docutils literal"><span class="pre">generateDS.py</span></tt>:</p> 
     1212<pre class="literal-block"> 
     1213&lt;xsd:element name=&quot;Foo&quot;&gt; 
     1214    &lt;xsd:complexType&gt; 
     1215        &lt;xsd:choice maxOccurs=&quot;unbounded&quot;&gt; 
     1216            &lt;xsd:element ref=&quot;Bar&quot;/&gt; 
     1217            &lt;xsd:element ref=&quot;Baz&quot;/&gt; 
     1218        &lt;/xsd:choice&gt; 
     1219    &lt;/xsd:complexType&gt; 
     1220&lt;/xsd:element&gt; 
     1221</pre> 
     1222</div> 
     1223<div class="section" id="minoccurs-attribute-support"> 
     1224<h2><a class="toc-backref" href="#id41">7.5&nbsp;&nbsp;&nbsp;minOccurs attribute support</a></h2> 
     1225<p>Some applications require the availability of the &quot;minOccurs&quot; 
     1226attribute in addition to the previous minimal support of 
     1227&quot;optionality&quot;.  This is available through the <tt class="docutils literal"><span class="pre">getMinOccurs</span></tt> 
     1228method (which follows the style of the existing API).</p> 
     1229</div> 
     1230<div class="section" id="more-thorough-content-type-and-base-type-resolution"> 
     1231<h2><a class="toc-backref" href="#id42">7.6&nbsp;&nbsp;&nbsp;More thorough content type and base type resolution</a></h2> 
     1232<p>The previous content type and base type resolution is insufficient 
     1233for some needs.  Basically it was unable to handle more complex 
     1234and shared element and simpleType definitions.  This support has 
     1235been extended to more correctly resolve the base type and properly 
     1236indicate the content type of the element.  This should provide the 
     1237ability to handle more complex XML Schema definitions in 
     1238<tt class="docutils literal"><span class="pre">generateDS.py</span></tt>.  Documentation on the algorithm for how this is 
     1239achieved is available as comments in the source code of 
     1240<tt class="docutils literal"><span class="pre">generateDS.py</span></tt> -- see comments in method <tt class="docutils literal"><span class="pre">resolve_type</span></tt> in 
     1241class <tt class="docutils literal"><span class="pre">XschemaElement</span></tt>.</p> 
     1242</div> 
     1243<div class="section" id="making-top-level-simpletypes-available-from-xschemahandler"> 
     1244<h2><a class="toc-backref" href="#id43">7.7&nbsp;&nbsp;&nbsp;Making top level simpleTypes available from XschemaHandler</a></h2> 
     1245<p>Some developers working to extend the analysis and code generation 
     1246in <tt class="docutils literal"><span class="pre">generateDS.py</span></tt> may be helped by additional information 
     1247collected during the parsing of the XML Schema file.</p> 
     1248<p>Some applications need all the top level simpleTypes to be 
     1249available for further queries after the SAX parser has completed 
     1250its work and after all types have been resolved.  These types are 
     1251available as an instance attribute <tt class="docutils literal"><span class="pre">topLevelSimpleTypes</span></tt> inside 
     1252<tt class="docutils literal"><span class="pre">XschemaHandler</span></tt>.</p> 
     1253</div> 
     1254</div> 
    11581255<div class="section" id="how-to-use-the-generated-source-code"> 
    1159 <h1><a class="toc-backref" href="#id36">7&nbsp;&nbsp;&nbsp;How-to Use the Generated Source Code</a></h1> 
     1256<h1><a class="toc-backref" href="#id44">8&nbsp;&nbsp;&nbsp;How-to Use the Generated Source Code</a></h1> 
    11601257<div class="section" id="the-parsing-functions"> 
    1161 <h2><a class="toc-backref" href="#id37">7.1&nbsp;&nbsp;&nbsp;The parsing functions</a></h2> 
     1258<h2><a class="toc-backref" href="#id45">8.1&nbsp;&nbsp;&nbsp;The parsing functions</a></h2> 
    11621259<p>The simplest use is to call one of the parsing functions in the 
    11631260generated source file. You may be able to use one of these 
    … …  
    11851282</div> 
    11861283<div class="section" id="the-export-methods"> 
    1187 <h2><a class="toc-backref" href="#id38">7.2&nbsp;&nbsp;&nbsp;The export methods</a></h2> 
     1284<h2><a class="toc-backref" href="#id46">8.2&nbsp;&nbsp;&nbsp;The export methods</a></h2> 
    11881285<p>The generated classes contain methods <tt class="docutils literal"><span class="pre">export</span></tt> and 
    11891286<tt class="docutils literal"><span class="pre">exportLiteral</span></tt> which can be called to export classes to several 
    … …  
    11921289functions for examples showing how to call the export methods.</p> 
    11931290<div class="section" id="method-export"> 
    1194 <h3><a class="toc-backref" href="#id39">7.2.1&nbsp;&nbsp;&nbsp;Method export</a></h3> 
     1291<h3><a class="toc-backref" href="#id47">8.2.1&nbsp;&nbsp;&nbsp;Method export</a></h3> 
    11951292<p>The export method in generated classes writes out an XML document 
    11961293that represents the instance that contains it and its child 
    … …  
    12011298</div> 
    12021299<div class="section" id="method-exportliteral"> 
    1203 <h3><a class="toc-backref" href="#id40">7.2.2&nbsp;&nbsp;&nbsp;Method <tt class="docutils literal"><span class="pre">exportLiteral</span></tt></a></h3> 
     1300<h3><a class="toc-backref" href="#id48">8.2.2&nbsp;&nbsp;&nbsp;Method <tt class="docutils literal"><span class="pre">exportLiteral</span></tt></a></h3> 
    12041301<p><tt class="docutils literal"><span class="pre">generateDS.py</span></tt> generates Python classes that represent the 
    12051302elements in an XML document, given an Xschema definition of the 
    … …  
    12081305classes that represent an XML document.</p> 
    12091306<div class="section" id="what-it-does"> 
    1210 <h4><a class="toc-backref" href="#id41">7.2.2.1&nbsp;&nbsp;&nbsp;What It Does</a></h4> 
     1307<h4><a class="toc-backref" href="#id49">8.2.2.1&nbsp;&nbsp;&nbsp;What It Does</a></h4> 
    12111308<p>When <tt class="docutils literal"><span class="pre">generateDS.py</span></tt> generates the Python source code for your 
    12121309classes, this new feature also generates an <tt class="docutils literal"><span class="pre">exportLiteral</span></tt> 
    … …  
    12221319</div> 
    12231320<div class="section" id="why-you-might-care"> 
    1224 <h4><a class="toc-backref" href="#id42">7.2.2.2&nbsp;&nbsp;&nbsp;Why You Might Care</a></h4> 
     1321<h4><a class="toc-backref" href="#id50">8.2.2.2&nbsp;&nbsp;&nbsp;Why You Might Care</a></h4> 
    12251322<p><tt class="docutils literal"><span class="pre">generateDS.py</span></tt> was designed and built with the assumption that 
    12261323we are <em>not</em> interested in marking up text content at all.  What 
    … …  
    12651362</div> 
    12661363<div class="section" id="how-to-use-it"> 
    1267 <h4><a class="toc-backref" href="#id43">7.2.2.3&nbsp;&nbsp;&nbsp;How to use it</a></h4> 
     1364<h4><a class="toc-backref" href="#id51">8.2.2.3&nbsp;&nbsp;&nbsp;How to use it</a></h4> 
    12681365<p>See the generated function <tt class="docutils literal"><span class="pre">parseLiteral</span></tt> for an example of how 
    12691366to use <tt class="docutils literal"><span class="pre">exportLiteral</span></tt>.</p> 
    … …  
    12721369</div> 
    12731370<div class="section" id="building-instances"> 
    1274 <h2><a class="toc-backref" href="#id44">7.3&nbsp;&nbsp;&nbsp;Building instances</a></h2> 
     1371<h2><a class="toc-backref" href="#id52">8.3&nbsp;&nbsp;&nbsp;Building instances</a></h2> 
    12751372<p>If you have an instance of a minidom node that represents an 
    12761373element in an XML document, you can also use the 'build' member 
    … …  
    12921389</div> 
    12931390<div class="section" id="using-the-subclass-module"> 
    1294 <h2><a class="toc-backref" href="#id45">7.4&nbsp;&nbsp;&nbsp;Using the subclass module</a></h2> 
     1391<h2><a class="toc-backref" href="#id53">8.4&nbsp;&nbsp;&nbsp;Using the subclass module</a></h2> 
    12951392<p>If you choose to use the generated subclass module, and I 
    12961393encourage you to do so, you may need to edit and modify that 
    … …  
    13191416</div> 
    13201417<div class="section" id="elements-with-attributes-but-no-nested-children"> 
    1321 <h2><a class="toc-backref" href="#id46">7.5&nbsp;&nbsp;&nbsp;Elements with attributes but no nested children</a></h2> 
     1418<h2><a class="toc-backref" href="#id54">8.5&nbsp;&nbsp;&nbsp;Elements with attributes but no nested children</a></h2> 
    13221419<p>Element definitions that contain attributes but <em>no</em> nested child 
    13231420elements provide access to their data content through getter and 
    … …  
    13261423</div> 
    13271424<div class="section" id="id3"> 
    1328 <span id="id2"></span><h2><a class="toc-backref" href="#id47">7.6&nbsp;&nbsp;&nbsp;Mixed content</a></h2> 
     1425<span id="id2"></span><h2><a class="toc-backref" href="#id55">8.6&nbsp;&nbsp;&nbsp;Mixed content</a></h2> 
    13291426<p>The goal of <tt class="docutils literal"><span class="pre">generateDS.py</span></tt> is to support data structures 
    13301427represented in XML as opposed to text mark-up.  However, it does 
    … …  
    13941491</div> 
    13951492<div class="section" id="id5"> 
    1396 <span id="id4"></span><h2><a class="toc-backref" href="#id48">7.7&nbsp;&nbsp;&nbsp;anyAttribute</a></h2> 
     1493<span id="id4"></span><h2><a class="toc-backref" href="#id56">8.7&nbsp;&nbsp;&nbsp;anyAttribute</a></h2> 
    13971494<p>For elements that specify <tt class="docutils literal"><span class="pre">anyAttributes</span></tt>, <tt class="docutils literal"><span class="pre">generateDS.py</span></tt> 
    13981495produces a class containing the following:</p> 
    … …  
    14151512</div> 
    14161513<div class="section" id="user-methods"> 
    1417 <h2><a class="toc-backref" href="#id49">7.8&nbsp;&nbsp;&nbsp;User Methods</a></h2> 
     1514<h2><a class="toc-backref" href="#id57">8.8&nbsp;&nbsp;&nbsp;User Methods</a></h2> 
    14181515<p><tt class="docutils literal"><span class="pre">generateDS.py</span></tt> provides a mechanism that enables you to attach 
    14191516user defined methods to specific generated classes.  In order to 
    … …  
    15211618</div> 
    15221619<div class="section" id="how-to-modify-the-generated-code"> 
    1523 <h1><a class="toc-backref" href="#id50">8&nbsp;&nbsp;&nbsp;How-to Modify the Generated Code</a></h1> 
     1620<h1><a class="toc-backref" href="#id58">9&nbsp;&nbsp;&nbsp;How-to Modify the Generated Code</a></h1> 
    15241621<p>This section attempts to explain how to modify and add features to 
    15251622the generated code.</p> 
    15261623<div class="section" id="adding-features-to-class-definitions"> 
    1527 <h2><a class="toc-backref" href="#id51">8.1&nbsp;&nbsp;&nbsp;Adding features to class definitions</a></h2> 
     1624<h2><a class="toc-backref" href="#id59">9.1&nbsp;&nbsp;&nbsp;Adding features to class definitions</a></h2> 
    15281625<p>You can add new member definitions to a generated class. Look at 
    15291626the 'export' and 'exportLiteral' member functions for examples of 
    … …  
    15701667</div> 
    15711668<div class="section" id="examples-and-demonstrations"> 
    1572 <h1><a class="toc-backref" href="#id52">9&nbsp;&nbsp;&nbsp;Examples and Demonstrations</a></h1> 
     1669<h1><a class="toc-backref" href="#id60">10&nbsp;&nbsp;&nbsp;Examples and Demonstrations</a></h1> 
    15731670<p>Under the directory Demos are several examples:</p> 
    15741671<ul class="simple"> 
    … …  
    15961693</div> 
    15971694<div class="section" id="limitations-of-generateds"> 
    1598 <h1><a class="toc-backref" href="#id53">10&nbsp;&nbsp;&nbsp;Limitations of generateDS</a></h1> 
     1695<h1><a class="toc-backref" href="#id61">11&nbsp;&nbsp;&nbsp;Limitations of generateDS</a></h1> 
    15991696<div class="section" id="xml-schema-limitations"> 
    1600 <h2><a class="toc-backref" href="#id54">10.1&nbsp;&nbsp;&nbsp;XML Schema limitations</a></h2> 
     1697<h2><a class="toc-backref" href="#id62">11.1&nbsp;&nbsp;&nbsp;XML Schema limitations</a></h2> 
    16011698<p>There are things in Xschema that are not supported. You will have 
    16021699to use a restricted sub-set of Xschema to define your data 
    … …  
    16071704</div> 
    16081705<div class="section" id="large-documents"> 
    1609 <h2><a class="toc-backref" href="#id55">10.2&nbsp;&nbsp;&nbsp;Large documents</a></h2> 
     1706<h2><a class="toc-backref" href="#id63">11.2&nbsp;&nbsp;&nbsp;Large documents</a></h2> 
    16101707<p><strong>Warning</strong> -- This section describes an optional generated SAX 
    16111708parser which, I believe, is currently broken for all but the 
    … …  
    16341731</div> 
    16351732<div class="section" id="includes-the-xml-schema-include-element"> 
    1636 <h1><a class="toc-backref" href="#id56">11&nbsp;&nbsp;&nbsp;Includes -- The XML Schema include element</a></h1> 
     1733<h1><a class="toc-backref" href="#id64">12&nbsp;&nbsp;&nbsp;Includes -- The XML Schema include element</a></h1> 
    16371734<p>While <tt class="docutils literal"><span class="pre">generateDS.py</span></tt> itself does not process XML Schema 
    16381735<tt class="docutils literal"><span class="pre">include</span></tt> elements, the distribution provides a script 
    … …  
    16651762</pre> 
    16661763</div> 
     1764<div class="section" id="acknowledgment"> 
     1765<h1><a class="toc-backref" href="#id65">13&nbsp;&nbsp;&nbsp;Acknowledgment</a></h1> 
     1766<p>Many thanks to those who have used <tt class="docutils literal"><span class="pre">generateDS.py</span></tt> and have 
     1767contributed their comments and suggestions.  These comments have 
     1768been valuable both in teaching me about things I needed to know in 
     1769order to continue work and in motivating me to do the work in the 
     1770first place.</p> 
     1771<p>And, a special thanks to those of you who have contributed patches 
     1772for fixes and new features.  Recent help has been provided by the 
     1773following among others:</p> 
     1774<ul class="simple"> 
     1775<li>Chris Allan -- for several feature additions.</li> 
     1776</ul> 
     1777</div> 
    16671778<div class="section" id="see-also"> 
    1668 <h1><a class="toc-backref" href="#id57">12&nbsp;&nbsp;&nbsp;See Also</a></h1> 
     1779<h1><a class="toc-backref" href="#id66">14&nbsp;&nbsp;&nbsp;See Also</a></h1> 
    16691780<p><a class="reference external" href="http://www.python.org">Python</a>: The Python home page.</p> 
    16701781<p><a class="reference external" href="http://www.rexx.com/~dkuhlman">Dave's Page</a>: My home page, which contains more Python stuff.</p> 
  • Xml/xsd-fu/trunk/generateDS/generateDS.py

    r111 r112  
    99    python generateDS.py [ options ] - 
    1010Options: 
     11    -h, --help               Display this help information. 
    1112    -o <outfilename>         Output file name for data representation classes 
    1213    -s <subclassfilename>    Output file name for subclasses 
    … …  
    36903691        UserMethodsPath 
    36913692    args = sys.argv[1:] 
    3692     options, args = getopt.getopt(args, 'fyo:s:p:a:b:mu:', 
    3693         ['subclass-suffix=', 'root-element=', 'super=', 
     3693    options, args = getopt.getopt(args, 'hfyo:s:p:a:b:mu:', 
     3694        ['help', 'subclass-suffix=', 'root-element=', 'super=', 
    36943695        'validator-bodies=', 'use-old-getter-setter', 
    36953696        'user-methods=', 
    … …  
    37023703    superModule = '???' 
    37033704    for option in options: 
    3704         if option[0] == '-p': 
     3705        if option[0] == '-h' or option[0] == '--help': 
     3706            usage() 
     3707        elif option[0] == '-p': 
    37053708            prefix = option[1] 
    37063709        elif option[0] == '-o': 
  • Xml/xsd-fu/trunk/generateDS/setup.py

    r111 r112  
    33 
    44setup(name="generateDS", 
    5     version="1.10a", 
     5    version="1.11a", 
    66    description="Generation of Python data structures and XML parser from Xschema", 
    77    author="Dave Kuhlman", 
  • Xml/xsd-fu/trunk/generateDS/tests/out1sub.py

    r111 r112  
    22 
    33# 
    4 # Generated Tue Aug 21 11:04:53 2007 by generateDS.py. 
     4# Generated Tue Oct  9 11:33:52 2007 by generateDS.py. 
    55# 
    66 
  • Xml/xsd-fu/trunk/generateDS/tests/out1sup.py

    r111 r112  
    22 
    33# 
    4 # Generated Tue Aug 21 11:04:52 2007 by generateDS.py. 
     4# Generated Tue Oct  9 11:33:52 2007 by generateDS.py. 
    55# 
    66 
    … …  
    342342            outfile.write(' %s="%s"' % (name, value, )) 
    343343    def exportChildren(self, outfile, level, name_='person'): 
    344         if self.getName() != None : 
    345             showIndent(outfile, level) 
    346             outfile.write('<name>%s</name>\n' % quote_xml(self.getName())) 
     344        if self.get_name() != None : 
     345            showIndent(outfile, level) 
     346            outfile.write('<name>%s</name>\n' % quote_xml(self.get_name())) 
    347347        showIndent(outfile, level) 
    348348        outfile.write('<ratio>%s</ratio>\n' % quote_xml(self.get_ratio())) 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

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