Randall Smith <[EMAIL PROTECTED]> writes:

> 
> When generateds creates a class for an element like this:
> 
> <xsd:element name="LabReport" type="EN:LabReportDataType">
> 
> it creates a class named LabReportDataType, that when exported, uses the
> name LabReportDataType.  Shouldn't the exported name be LabReport
> instead of LabReportDataType?
> 

Hmmm.  My test shows that it *does* export the element name rather than the type
name.  Perhaps there is something special about my test so that it does not
expose the behavior you describe.

If you want to try my test, I've included an XML Schema and an XML instance
document that you can feed through the code generated from the Schema.  Then
take a look at the promoter/booster element.

(I apologize for pasting these files instead of attaching them.  Hope it does
not get garbled.  I have to use the gmane.org interface because sourceforge.net
will not allow me to post from my email account.)

- Dave

===================================================================
file: people_2.xsd

<?xml version="1.0"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema";
    xmlns:pl="http://kuhlman.com/people.xsd";
    targetNamespace="http://kuhlman.com/people.xsd";
>
<!-- -*- html -*- -->


    <xs:element name="people">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="person" maxOccurs="unbounded" type="person"/>
                        </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="person">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="name" type="xs:string"
                    minOccurs="0"/>
                <xs:element name="ratio" type="percent" />
                <xs:element name="imagesize" type="scale" />
                <xs:element name="imageproperty" type="descriptor" />
                <xs:element name="interest" type="xs:string" 
maxOccurs="unbounded"/>
                <xs:element name="category" type="xs:integer" default="-2"/>
                <xs:element name="hot.agent" type="hot.agent" />
                <xs:element name="promoter" type="booster" 
maxOccurs="unbounded" />
                <xs:element name="hot" type="BasicEmptyType" />
                <xs:element name="size" type="xs:int" />
                <xs:element name="registered" type="xs:boolean" />
            </xs:sequence>
            <xs:attribute name="value" default="nobody 'here'" />
            <xs:attribute name="id" type="xs:integer" />
            <xs:attribute name="ratio" type="xs:float" />
            <xs:attribute name="activated" type="xs:boolean" />
            <xs:anyAttribute namespace="##other" processContents="lax"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="percent">
    <xs:simpleType>
        <xs:restriction base="xs:integer">
            <xs:minInclusive value="1"/>
            <xs:maxInclusive value="100"/>
        </xs:restriction>
    </xs:simpleType>
    </xs:element>

    <xs:element name="scale">
        <xs:simpleType>
            <xs:restriction base="xs:integer">
                <xs:minInclusive value="1"/>
                <xs:maxInclusive value="100"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>


    <xs:element name="descriptor">
        <xs:simpleType>
            <xs:restriction base="xs:string">
            </xs:restriction>
        </xs:simpleType>
        <xs:attribute name="attrib1" type="xs:string" />
    </xs:element>


   <xs:complexType name="BasicEmptyType">
     <!-- no content defined: no sub elements, no attrs -->
   </xs:complexType>

    <xs:element name="hot.agent">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="firstname" type="xs:string"
                    default="empty\name"/>
                <xs:element name="lastname" type="xs:string"
                    default="no 'last' name"/>
                <xs:element name="priority" type="xs:float"/>
            </xs:sequence>
            <xs:anyAttribute namespace="##other" processContents="lax"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="booster">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="firstname" type="xs:string"
                    default="booster 'first' name"/>
                <xs:element name="lastname" type="xs:string"
                    default="booster 'last' name"/>
                <xs:element name="client" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="fullname" type="xs:string"/>
                            <xs:element name="refid" type="xs:integer"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>

===================================================================
file: people.xml

<?xml version="1.0"?>
<people> 
    <person id="1" value="abcd" ratio="3.2">
        <name>Alberta</name>
        <ratio>25</ratio>
        <imagesize>42</imagesize>
        <interest>gardening</interest>
        <interest>reading</interest>
        <category>5</category>
    </person> 

    <person id="2">
        <name>Bernardo</name>
        <interest>programming</interest>
        <category></category>
        <hot.agent>
            <firstname>Darren</firstname>
            <lastname>Diddly</lastname>
        </hot.agent>

    </person>

    <person id="3" activated="1">
        <name>Charlie</name>
        <interest>people</interest>
        <interest>cats</interest>
        <interest>dogs</interest>
        <imagesize>78</imagesize>
        <registered>0</registered>
        <imageproperty attrib1="abc &lt;def> ghi">some pretty 
stuff</imageproperty>
        <category>8</category>
        <promoter>
            <firstname>David</firstname>
            <lastname>Donaldson</lastname>
            <client>
                <fullname>Arnold Applebee</fullname>
                <refid>10001</refid>
            </client>
        </promoter>
        <promoter>
            <firstname>Edward</firstname>
            <lastname>Eddleberry</lastname>
            <client>
                <fullname>Arnold Applebee</fullname>
                <refid>10002</refid>
            </client>
        </promoter>
        <promoter>
            <client>
                <fullname>Charlie Chuckles</fullname>
                <refid>10003</refid>
            </client>
        </promoter>
    </person>

</people>

===================================================================





-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to