Hi Mark,

The situation you are describing is that when you use an element which
contains some children:

<A> 
   <foo>12</foo>
   <bar>34</bar>
</A>
Then if foo and bar are empty you still see
<A></A> which you would like to avoid is that right?
Can you send the piece of code you are using (schema + marshalling
code)?
The logic inplace in the SourceGenerator relies on the 'hasXXX' method
for primitives which allows detecting if a primitive has been set or not
in order to controller the output. 
A recent discussion on the list concluded that the hasXXX method would
also be nice for treating objects since it will help finishing the
support for 'default' value.

Hope this helps,

Arnaud
-----Original Message-----
From: Mark Goodwin [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 13, 2003 10:35 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Castor XML Marshaller creates empty segment


Hello Arnaud
By segment I really mean an element that contains child elements.  If
the actual xml produced by the marshaller does not contain any child
elements then the parent element begin/end tags are still written out by
the marshaller.  
I am using classes generated by
org.exolab.castor.builder.FieldInfoFactoryJ2 from a schema that defines
the required xml.
What do you mean by 'In the Source Generator Castor has the necessary
logic to prevent empty element from being outputted'?

Thanks,

Mark

-----Original Message-----
From: Arnaud Blandin [mailto:[EMAIL PROTECTED]
Sent: Saturday, 12 July 2003 6:09 a.m.
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Castor XML Marshaller creates empty segment


Hi Mark,

What do you call a segment? Are you using default introspection, mapping
file or Source Generator?
In the Source Generator Castor has the necessary logic to prevent empty
element from being outputted.

Thanks,

Arnaud
-----Original Message-----
From: Mark Goodwin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2003 2:01 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Castor XML Marshaller creates empty segment


Hello 
When a segment has no elements the castor XML marshaller creates an
empty segment. 
Is it possible to configure castor so that no segment is created. 
If the schema says the segment is optional this seem logical. 
Thanks 



The information contained in this e-mail (and any accompanying
attachments) is confidential and may be legally privileged. The
information is intended only for the recipient(s) named in this message.
Any reading, copying, distribution or any other use of the information
by the intended recipient other than the addressee/s is prohibited. If
you have received this message in error, please delete the message and
any attachments and notify HealthPAC immediately by email to
[EMAIL PROTECTED]
The information contained in this e-mail (and any accompanying
attachments) is confidential and may be legally privileged. The
information is intended only for the recipient(s) named in this message.
Any reading, copying, distribution or any other use of the information
by the intended recipient other than the addressee/s is prohibited. If
you have received this message in error, please delete the message and
any attachments and notify HealthPAC immediately by email to
[EMAIL PROTECTED]

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

Reply via email to