Hi Enrique,

Make sure you are generated the descriptors as well as the object model.
When using the Source Generator, it is not needed to use a mapping file.
The mapping file can be used in combination with generated sources to
express business logic or inheritance relationship between the generated
object model and already existing object model.

Arnaud

-----Original Message-----
From: Enrique Rodríguez [mailto:erodriguez@;nht-norwick.net] 
Sent: Monday, November 11, 2002 3:45 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] can Castor do it???

I use Castor Source Generator. These are the two options I'm trying to
use: 
   <xsd:element name="Range"> 
      <xsd:complexType> 
          <xsd:sequence>      
                <xsd:element name="IDAudienceRange"
type="xsd:integer"/>                
                    <xsd:element name="audienceRangeQualifier"
type="xsd:string"/> 
                <xsd:element ref="RangePrecisionValue"
maxOccurs="unbounded" minOccurs="0"/> 
          </xsd:sequence> 
      </xsd:complexType> 
   </xsd:element> 
   
<xsd:element name="RangePrecisionValue"> 
      <xsd:complexType> 
          <xsd:sequence>      
                <xsd:element name="IDRangePrecisionValue"
type="xsd:integer"/>                  
                    <xsd:element name="rangePrecision"
type="xsd:string"/> 
                <xsd:element name="rangeValue" type="xsd:string"/> 
                <xsd:element name="range" ref="Range"/> 
          </xsd:sequence> 
      </xsd:complexType> 
</xsd:element> 
OR 
   <xsd:element name="Range"> 
      <xsd:complexType> 
          <xsd:sequence>      
                <xsd:element name="IDRange"
type="xsd:integer"/>                
                    <xsd:element name="rangeQualifier"
type="xsd:string"/> 
                <xsd:element name="rangePrecisionValue"> 
                  <xsd:complexType> 
                    <xsd:sequence minOccurs="0" maxOccurs="unbounded"> 
                        <xsd:element name="IDRangePrecisionValue"
type="xsd:integer"/> 
                        <xsd:element name="rangePrecision"
type="xsd:string"/> 
                        <xsd:element name="rangeValue"
type="xsd:string"/> 
                        <xsd:element name="range" ref="AudienceRange"/> 
                    </xsd:sequence> 
                  </xsd:complexType> 
                </xsd:element>                 
          </xsd:sequence> 
      </xsd:complexType> 
   </xsd:element> 

but MY problem is the mapping.xml. Maybe is sothing very easy, but i
don't know how to marshall, unmarshall this kind of schema.
Any help would be very aprreciated. 
Regards, Enrique. 
   
-----Mensaje original----- 
De: Arnaud Blandin [mailto:blandin@;intalio.com] 
Enviado el: lunes, 11 de noviembre de 2002 14:18 
Para: [EMAIL PROTECTED] 
Asunto: Re: [castor-dev] can Castor do it??? 

Hi Enrique, 
Why not using the Source Generator to generate the java object model 
from the schema? 
The mapping API intends to provide information mostly on the java model 
you want to marshal to xml and unmarshal from xml. It doesn't define an 
XML grammar by itself (even though it lets you specify some XML 
datatyping). What you are asking for is typically the expression of an 
XML Schema rule thus in that case the solution is to use the Source 
Generator. 
Hope that helps, 
Arnaud 
-----Original Message----- 
From: Enrique Rodríguez [mailto:erodriguez@;nht-norwick.net] 
Sent: Monday, November 11, 2002 2:01 PM 
To: [EMAIL PROTECTED] 
Subject: [castor-dev] can Castor do it??? 
Past week i asked for a solution to my problem. i Have to marshall and 
unmarshall an xml document like this... 
<Range> 
    <RangeQualifier>Description</RangeQualifier> 
    <RangePrecision>From</RangePrecision> 
    <RangeValue>15</RangeValue> 
    <RangePrecision>To</RangePrecision> 
    <RangeValue>45</RangeValue> 
</AudienceRange> 
RangePrecision and RangeValue always are joined, and as you can see, can

be repeatable. 
the xml-schema can support this, but "I think", castor not. 
If anybody know how can I do it, PLEASE, help me. 
Now, i can make the unmarshal process with something like that: 
        <field name="setValues" 
               type="RangePrecisionValue" 
               collection="vector" 
               
set-method="addRangePrecisionValue">                               
               <bind-xml node="element" matches="*"/> 
        </field> 
I add some code to the method addRangePrecisionValue. In this method i 
receive all the tags values and create the objects I need. But I don't 
find any clue with the marshall process. 
Regards, Enrique. 
----------------------------------------------------------- 
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