Dave,
Having looked at this, it seems pretty reasonable.
My only comment is that if it were possible to add metadata to each
generated class to describe what xml nodes it would correspond to, then it
would be feasible to provide a generic implementation of gds_build_any which
maintained an index of subclasses and their corresponding node types to
decide which to use for building the any node.
I'm willing to sketch out a generic gds_build_any, but I would probably need
some guidance on hacking generateDS.py if you would like any direct help of
that sort.
On Fri, Oct 21, 2011 at 16:52, Dave Kuhlman <dkuhl...@pacbell.net> wrote:
> >From: Marcin Tustin
> >Sent: Wednesday, October 19, 2011 5:05 AM
> >
> > Hi all,
> >
> > I have to work with the schema here:
> > http://xmlgw.companieshouse.gov.uk/v2-1/schema/Egov_ch-v2-0.xsd
> >
> > You will see that contains an 'xsd:any' element as the specification
> > for the Body element. GenerateDS treats Body as having no members or
> > content. Is there any plan to support 'any' specifications?
> >
>
> Marcin -
>
> Yes. I've mapped out a possible approach to a solution, but have
> not yet started work on it.
>
> I've attached two classes that I've modified by hand to show
>
> the code that we might generate to handle xs:any. The second
> class shows code that might be generated for
>
>
> <xs:any ... maxOccurs="unbounded" />
> This approach assumes that the user will implement the method
> gds_build_any, and that s/he will do so as follows: (1) create a
> file generatedssup.py, (2) copy the class GeneratedsSuper from a
> generated module into that file, (3) implement the empty method
> gds_build_any() in that class, and (4) put this module where it can
> be imported when the user's application is run.
>
> If you get time to take a look at this code, please give me your
> oppinion about whether it would be a reasonable solution. I'd be
> interested in any other suggestions, too.
>
> - Dave
>
>
>
>
>
>
> --
>
>
> Dave Kuhlman
> http://www.rexx.com/~dkuhlman
--
Marcin Tustin
Tel: 07773 787 105
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users