On Thu, Nov 30, 2006 at 05:41:01PM +0000, Mark J Hewitt wrote: [snip]
> > So - I enriched the schema to use this idiom: > > > <xs:simpleType name="emptyString"> > <xs:restriction base="xs:string"> > <xs:whiteSpace value="collapse"/> > </xs:restriction> > </xs:simpleType> > > <xs:element name="merge"> > <xs:complexType> > <xs:simpleContent> > <xs:extension base="emptyString"> > <xs:attribute name="fromTag" type="xs:string" use="required"/> > <xs:attribute name="toTag" type="xs:string" use="required"/> > <xs:attribute name="sourceBranch" type="xs:string" use="required"/> > <xs:attribute name="date" type="xs:string" use="required"/> > </xs:extension> > </xs:simpleContent> > </xs:complexType> > </xs:element> > > which certainly makes JAXB perform better, but now generateDS generated > classes say: > > [EMAIL PROTECTED] proto]$ python productmetadata.py > ../../sandbox/pc-521/take5/meta/trunk/Sourcing.xml > Traceback (most recent call last): > File "productmetadata.py", line 691, in ? > class merge(emptyString): > NameError: name 'emptyString' is not defined > > > I thought there were similar schema elements to this described in the > 1.9a documentation - so I was wondering if this is supposed to be > supported, but has a bug, or if this is not supported? > > Thanks for any advice you might have ! Mark - I've basically done two things in response to the problem you have identified. 1. I fixed generateDS.py so that it generates export methods that do not produce extra whitespace (and new lines) when an element has no children and no character content. 2. I fixed generateDS.py so that it will produce code Python error in the traceback above (NameError: name 'emptyString' is not defined). Although, the element definition, in this example: xs:simpleType name="emptyString" is basically ignored, I believe that the generated code still does what you want it to do. So for generateDS.py, the whiteSpace/collapse thing is unnecessary, but does no harm. I'm hoping that this will enable you to use the same XML Schema (.xsd file) with both JAXB and generateDS.py. Please let me know your thoughts on this. You can download that latest version with these fixes here: http://sourceforge.net/projects/generateds/ You can also find it in the usual place at my Web site: http://www.rexx.com/~dkuhlman/generateDS-1.9a.tar.gz Thanks much for finding this problem and telling me about it. Please let me have your comments. Note that I have also posted this message to the Source Forge email list for generateDS.py, just in case someone reading that list and can learn from this. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ generateds-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/generateds-users