Vincent, > first I would like to thank you a lot for your generateDS script > and the good documentation. > > I have a question regarding the setting of default values.
You are welcome. I appreciate the comment. It seems that you want to be able to specify a default value that is an xs:complexType. I do not know how you would do that. Suppose you had: <xs:complexType name="complexTypeA"> <xs:sequence> <xs:element name="description" type="xs:string"/> <xs:element name="item1" type="complexTypeB" default="xxx"/> </xs:sequence> </xs:complexType> What would you put in the place of xxx? I know how to specify a default value for primitive and simple types (for example, an xs:string, an xs:integer, or an xs:simpleType that restricts a primitive type). But, I do not know how to do that for complex types. I did several Web searches, but found no help on how to do that. I believe that default values must simple types. Am I interpreting your question incorrectly? If so, please straighten me out. By the way, your task (loading a database from an XML instance document) seems like a ETL (extract, transform, load) sort of problem. I am currently working on adding support to generateDS for a similar capability so that it can load XML data into a Django database. So, someday, maybe, I will have a little more support for that kind of task. Thank you for your question. And, if I can be of more help, please ask. Dave On Mon, Aug 13, 2018 at 10:32:42AM +0000, Vincent Helfre wrote: > Dear David, > first I would like to thank you a lot for your generateDS script > and the good documentation. > > I have a question regarding the setting of default values. > A customer gives me a xsd where all the default values are set > (for simple types). Then the structure can be quite deep and have > several levels that look like for example: > complexTypeA->ComplexTypeB->SimpleTypeC > I have to create a database in Python with the structure that > holds these default values. > The problem I am facing now is that for a tree like > complexTypeA->ComplexTypeB->SimpleTypeC, the constructor generated > via generateDS for the complexTypeA initializes ComplexTypeB with > None. So my structure does not hold the default values for > ComplexTypeB. > What works is that ComplexTypeB initializes SimpleTypeC with the > default values specified in the xsd. > Would you have a suggestion to initialize complexTypeA with a > default value for ComplexTypeB? > Thanks for your feedback! > Best regards, > > Vincent Helfre > > Application Engineer Protocol Test Solutions > Rohde & Schwarz Vertriebs GmbH > Mühldorfstraße 15, 81671 München > Tel. +49-(0)89-4129-13833 > Mobile: +49-(0)151-40650508 > Mail: > vincent.hel...@rohde-schwarz.com<mailto:vincent.hel...@rohde-schwarz.com> > Internet: http://www.rohde-schwarz.com > -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users