Re: [castor-dev] XML code generation in type mode

2006-10-20 Thread Werner Guttmann
Simple because Castor XML supports two modes in this context: 'type' and
'element', and the classes generated will differ between these two modes.

Werner

Stephen Bash wrote:
> Werner-
> 
> Not that I'm an expert on the source gen side of things, but I tend to
> agree with you, it all looks good until it comes to compile time...  I
> guess I don't understand the current contract.  Why don't we want to
> generate classes for top-level types?  Sorry I can't be of more help.
> 
> Stephen
> 
> 
> On 10/17/06, Werner Guttmann <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> As I have got some troubles getting my mind around the following
>> sitution, I'd appreciate any kind of feedback.
>>
>> In the HTML docs at
>>
>> http://www.castor.org/srcgen-properties.html#Class-Creation/Mapping
>>
>> it reads that
>>
>> Classes will not be generated for elements whose type is a
>> top-level type.
>>
>> Let's assume the following XML schema fragment:
>>
>> 
>> 
>>
>>   
>>
>> 
>>
>> 
>> 
>>
>>   
>>   
>>   
>>
>>
>> 
>>
>> In the complexType 'TransformsType', there's an unbounded sequence of
>> 'ds:Transform' elements, pointing to the global element definition for
>> 'Transforms'. In other words, Castor will try to create a
>> _transformElementList member of type e.g. java.util.Vector, and create
>> several methods for adding/removing/obtaining TransformElement
>> instances. So, the Java class TransformsType.java will have methods such
>> as ...
>>
>> public void addTransformElement(int index,
>> xml.c1568.xmlsig.TransformElement vTransformElement)
>>
>> which looks just fine to me.Problem is that - as per above definition of
>> the 'type' mode - no class will be generated for TransformElement,
>> causing compilation errors.
>>
>> Can anybody advise how to go about this in a semantically correct way
>> without breaking the current contract of the 'type' mode.
>>
>> Thanks
>> Werner
>>
>>
>> -
>> To unsubscribe from this list please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
> 
> -
> To unsubscribe from this list please visit:
> 
>http://xircles.codehaus.org/manage_email
> 
> 


-
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email



Re: [castor-dev] XML code generation in type mode

2006-10-19 Thread Stephen Bash

Werner-

Not that I'm an expert on the source gen side of things, but I tend to
agree with you, it all looks good until it comes to compile time...  I
guess I don't understand the current contract.  Why don't we want to
generate classes for top-level types?  Sorry I can't be of more help.

Stephen


On 10/17/06, Werner Guttmann <[EMAIL PROTECTED]> wrote:

Hi,

As I have got some troubles getting my mind around the following
sitution, I'd appreciate any kind of feedback.

In the HTML docs at

http://www.castor.org/srcgen-properties.html#Class-Creation/Mapping

it reads that

Classes will not be generated for elements whose type is a
top-level type.

Let's assume the following XML schema fragment:



   
  
   




   
  
  
  
   
   


In the complexType 'TransformsType', there's an unbounded sequence of
'ds:Transform' elements, pointing to the global element definition for
'Transforms'. In other words, Castor will try to create a
_transformElementList member of type e.g. java.util.Vector, and create
several methods for adding/removing/obtaining TransformElement
instances. So, the Java class TransformsType.java will have methods such
as ...

public void addTransformElement(int index,
xml.c1568.xmlsig.TransformElement vTransformElement)

which looks just fine to me.Problem is that - as per above definition of
the 'type' mode - no class will be generated for TransformElement,
causing compilation errors.

Can anybody advise how to go about this in a semantically correct way
without breaking the current contract of the 'type' mode.

Thanks
Werner


-
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email




-
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email