Randall Smith <[EMAIL PROTECTED]> writes:

> 
> Dave,
> 
> I'm using the new version and it's not generating the names differently. 
>   It's still using the the type names.
> 
> For example:
> 
> <xsd:element name="Receiver" type="EN:ContactPointDataType">
> 
> should generate a class Receiver, but instead it generates a class 
> ContactPointDataType

Let me try to understand this.  

Because of type="EN:ContactPointDataType", there must be a type
named ContactPointDataType defined somewhere.  Therefore, a class
ContactPointDataType should be generated, which is what
generateDS.py currently generates.  I believe that we must generate
class ContactPointDataType because this type may be referred to
elsewhere in the schema.

It seems to me that:

    <xsd:element name="Receiver" type="EN:ContactPointDataType">

declares that Receiver is an alias for ContactPointDataType.  I
believe that generateDS.py treats it as an alias during the
generation of the Python code, but that the generated Python code
does not contain a definition of this alias.

Perhaps what you are asking for is something like the following:

    class ContactPointDataType(object):
        o
        o
        o
    # end class ContactPointDataType

    Receiver = ContactPointDataType

which effectively makes the name Receiver an alias for (refer to)
the class ContactPointDataType.

So, a few questions:

1. Do you agree that we should be generating a class
ContactPointDataType?

2. In the generated code, do you also need a class Receiver?  If
so, why?  Does the generated code not correctly handle instance
documents?  I do not have an instance XML document that obeys this
schema, so I don't know.

3. If you do need it (Receiver), would the above "alias" in the
generated code give you what you need?

> 
> Here are the schemas I'm using:
> 
> http://www.epa.gov/ogwdw/sdwis_st/web_release>
/zips/sdwis_xml_sampling_20_schemas.zip

Thanks for this.  I ran this schema through generateDS.py.  And,
you are right, it does generate class ContactPointDataType (and
does not generate class Receiver).

My changes in the previous version, by the way, fixed generateDS.py
so that it generates code that refers to class ContactPointDataType
where it needs to rather than referring to a non-existent class
Receiver.

- Dave



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to