> Hi Dave,
> 
> Unfortunately, I have not had time to investigate this further. I tried
> PyXB a few years ago, but what I didn't like was that you needed PyXB
> installed just to use the generated python code. In my work, I am creating
> sample scripts for our users so they can see how one might go about using
> our RESTful APIs. It's preferable to me that they can use the scripts
> without much setup.
> 
> Hopefully I can take a look soon.
> 
> Thanks!
> 
> On Mon Nov 10 2014 at 3:33:47 PM Dave Kuhlman <dkuhl...@davekuhlman.org>
> wrote:
> 
> > > Hi Dave,

[snip]

> > > The issue is that the generated xml file has the following:
> > >
> > > <enum-list:simple-type-named-enumeration>ONE</enum-list:
> > simple-type-named-enumeration>
> > >
> > > but it should really be
> > >
> > > <simple-type-named-enumeration:simple-type-named-
> > enumeration>ONE</simple-type-named-enumeration:simple-type-
> > named-enumeration>

George,

The problem here is that namespace (simple-type-named-enumeration)
is defined in a file that is imported with <xs:import ... />.
generateDS.py uses process_includes.py to (recursively) combine all
included and imported files (referenced with xs:include and
xs:import) into a single document.  Schemas referenced with
xs:import (but not with xs:include) define elements and types in a
separate namespace (the targetNamespace, I believe).  But,
process_includes.py does not keep that namespace information.  In
order to solve this problem, the first step would be to enable
generateDS.py (process_includes.py, actually) to save that namespace
information from each imported document.

I'll start looking into that.  However, I suspect that this would
require a significant modification.  We'd have to maintain namespace
information about multiple imported documents, and because those
imported schemas can import other schemas, we'd have to remember the
effective scope of those imported schemas.  For example, if schema A
imports schema B which imports C, then the elements defined in C and
the namespace they are defined in would be effective in B, but not
in A.  I'm guessing here, since I'm learning this myself.

More later, when I know more.

Dave

-- 

Dave Kuhlman
http://www.davekuhlman.org

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to