Hi Daniel,

The non top-level elements shouldn't have any namespace associated,
since your Schema has element-form as "unqualified", but Castor still
should use the proper package when generating the classes, so it may be
a bug.

You could try adding a default namespace mapping (I haven't tried this,
so I'm hoping it does the trick) as such:

org.exolab.castor.builder.nspackages=\
                   urn:common.rqrs.datalex.com=com.datalex.rqrs.common,\
                   urn:xsd.rqrs.xerxes.com=com.xerxes.rcrs.xsd,\
                   =com.xerxes.rcrs.xsd

--Keith

Daniel Becker wrote:
> 
> Hello,
> We're trying to generate classes from the attached schema (and many, many
> others).
> All the classes generate correctly except some of them have no package.
> 
> The schema has elementFormDefault="unqualified"
> and is in the urn:xsd.rqrs.xerxes.com namespace
> 
> We map the urn:xsd.rqrs.xerxes.com namespace to com.xerxes.rcrs.xsd.
> 
> >From castorbuilder.properties:
> org.exolab.castor.builder.nspackages=\
>                   urn:common.rqrs.datalex.com=com.datalex.rqrs.common,\
>                   urn:xsd.rqrs.xerxes.com=com.xerxes.rcrs.xsd
> 
> When we generate the code the non-top level elements end up with no package.
> In this example OrientationRQ and AngularWidthRQ.
> 
> getTargetNamespace() in XMLBindingComponent appears to set the target
> namespace for non-top level elements to null when
> elementFormDefault="unqualified"
> 
> Is this behavior correct?
> I ask because 0.9.3.9 assigned the namespace from the schema to all
> elements.
> We're using 0.9.5.2 now.
> 
> Daniel
> 
> Schema begins:
> -----------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="urn:xsd.rqrs.xerxes.com"
> xmlns="urn:xsd.rqrs.xerxes.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> elementFormDefault="unqualified" attributeFormDefault="unqualified">
>         <xsd:element name="LocationRQ">
>                 <xsd:annotation>
>                         <xsd:documentation>Specifies multiple ways to define
> geographic point locations and areas, either as a single point (defined by
> latitute/longitude), a rectangle (2 points), a circle (point and distance)
> or a partial cercle (point, distance, orientation and deviation) .  All
> latitudes, longitudes and angles are expressed in radians by default.
> 
> 360 degrees = 2*PI radians
> or 1 degree = 180/PI radians
> or 1 radian = PI/180 degrees
>       </xsd:documentation>
>                 </xsd:annotation>
>                 <xsd:complexType>
>                         <xsd:choice>
>                                 <xsd:element ref="PositionRQ"/>
>                                 <xsd:element ref="RectangularAreaRQ"/>
>                                 <xsd:element ref="CircularAreaRQ"/>
>                         </xsd:choice>
>                 </xsd:complexType>
>         </xsd:element>
>         <xsd:element name="RectangularAreaRQ">
>                 <xsd:complexType>
>                         <xsd:annotation>
>                                 <xsd:documentation>The two PositionRQ
> elements represent any two opposite corners of a rectangular area - it is
> assumed that the rectangle defined is the smallest area defined by those two
> corners.
>         </xsd:documentation>
>                         </xsd:annotation>
>                         <xsd:sequence>
>                                 <xsd:element ref="PositionRQ" minOccurs="2"
> maxOccurs="2"/>
>                         </xsd:sequence>
>                 </xsd:complexType>
>         </xsd:element>
>         <xsd:element name="CircularAreaRQ">
>                 <xsd:complexType>
>                         <xsd:annotation>
>                                 <xsd:documentation>A circle where the
> PositionRQ represents the center and the DistanceRQ represents the radius.
>         </xsd:documentation>
>                         </xsd:annotation>
>                         <xsd:sequence>
>                                 <xsd:element ref="PositionRQ"/>
>                                 <xsd:element ref="DistanceRQ"/>
>                                 <xsd:element ref="SectorRQ" minOccurs="0">
>                                         <xsd:annotation>
>                                                 <xsd:documentation>A
> circle's sector (pie-slice shape) where the PositionRQ represents the center
> of the circle, the DistanceRQ its radius, the OrientationRQ the direction in
> which it faces, and the AngularWidthRQ is the angular width of the sector.
> For example:
> - a South-facing Semi-Circle would have an Orientation of 180 degrees and an
> Angular Width of 180 degrees
> - a Northwest-facing Quarter-Circle would have a Orientation of 315 degrees
> and an Angular Width of 90 degrees
> 
> The examples are provided in degrees for the sake of clarity, but note
> that the angles are defined in radians by default.
>             </xsd:documentation>
>                                         </xsd:annotation>
>                                 </xsd:element>
>                         </xsd:sequence>
>                 </xsd:complexType>
>         </xsd:element>
>         <xsd:element name="SectorRQ">
>                 <xsd:complexType>
>                         <xsd:sequence>
>                                 <xsd:element name="OrientationRQ"
> type="Angle"/>
>                                 <xsd:element name="AngularWidthRQ"
> type="Angle"/>
>                         </xsd:sequence>
>                 </xsd:complexType>
>         </xsd:element>
>         <xsd:element name="PositionRQ">
>                 <xsd:complexType>
>                         <xsd:attribute name="Latitude" type="xsd:decimal"
> use="required"/>
>                         <xsd:attribute name="Longitude" type="xsd:decimal"
> use="required"/>
>                         <xsd:attribute name="Units" type="AngleUnits"
> use="optional" default="Radians"/>
>                 </xsd:complexType>
>         </xsd:element>
>         <xsd:element name="DistanceRQ">
>                 <xsd:complexType>
>                         <xsd:attribute name="Value" type="xsd:decimal"
> use="required"/>
>                         <xsd:attribute name="Units" type="DistanceUnits"
> use="optional" default="Miles"/>
>                 </xsd:complexType>
>         </xsd:element>
>         <xsd:complexType name="Angle">
>                 <xsd:attribute name="Value" type="xsd:decimal"
> use="required"/>
>                 <xsd:attribute name="Units" type="AngleUnits" use="optional"
> default="Radians"/>
>         </xsd:complexType>
>         <xsd:simpleType name="DistanceUnits">
>                 <xsd:restriction base="xsd:string">
>                         <xsd:enumeration value="Kilometers"/>
>                         <xsd:enumeration value="Meters"/>
>                         <xsd:enumeration value="Miles"/>
>                         <xsd:enumeration value="Yards"/>
>                 </xsd:restriction>
>         </xsd:simpleType>
>         <xsd:simpleType name="AngleUnits">
>                 <xsd:restriction base="xsd:string">
>                         <xsd:enumeration value="Radians"/>
>                         <xsd:enumeration value="Degrees"/>
>                 </xsd:restriction>
>         </xsd:simpleType>
> </xsd:schema>
> 
> ------------------------
> Schema ends.
> 
> *********************************************************************
> This electronic transmission is strictly confidential and intended solely
> for the addressee. It may contain information which is covered by legal,
> professional or other privilege. If you are not the intended addressee,
> you must not disclose, copy or take any action in reliance of this
> transmission. If you have received this transmission in error,
> please notify the sender as soon as possible.
> 
> This footnote also confirms that this message has been swept
> for computer viruses.
> **********************************************************************
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to