Hi Keith,
you are right. Fortunately, I'd seen your comment before I started to try
the trick... Are there any plans when the "container element feature" will
be available?
Thanks, Peter

-----Urspr�ngliche Nachricht-----
Von: Keith Visco [mailto:[EMAIL PROTECTED]]
Gesendet am: Donnerstag, 29. November 2001 22:09
An: [EMAIL PROTECTED]
Betreff: Re: �castor-dev� ignore xml-elements possible?


Hi Peter,

Unfortunately you can't use the tip...since you need the elements inside
the name element.
You really doen't want to skip the name tag, you want to "unwrap" it and
essentially pretend it's children occur where the name element occurs.
We call this container elements. We have support for container objects
right now, but not container elements. We are working on it.

In the meantime, Arnaud's suggestion for XSLT transformation will do the
trick.

Thanks,

--Keith


Arnaud Blandin wrote:
> 
> Hi Peter,
> 
> we are working on adding a feature to automatically skip elements in the
mapping file
> but for the moment you can use an XSL stylesheet to remove your <name> tag
> or use the undocumented tip of the year :
> 
> http://www.mail-archive.com/[email protected]/msg00339.html
> 
> Hope this helps,
> 
> Arnaud
> 
> -> -----Original Message-----
> -> From: Fuhrmann Peter [mailto:[EMAIL PROTECTED]]
> -> Sent: Thursday, November 29, 2001 6:38 AM
> -> To: [EMAIL PROTECTED]
> -> Subject: [castor-dev] ignore xml-elements possible?
> ->
> ->
> -> Hi all,
> ->
> -> I try to use Castor for simple Java-XML-binding. And it's great,
> -> when usage
> -> of the code generation facility is possible. But I have an
> -> existing object
> -> model and a given XML document structure which does not perfectly fit
to
> -> each other. So I use the mapping file to define a mapping. But
> -> it does not
> -> work, because xml document and the object model have not an identical
> -> structure: For example, in a customer bean I have firstName and
lastName
> -> properties, in the xml document this information is encapsulated into
an
> -> additional <name> element, which has no correspondence in the bean (and
> -> there is no additional name object):
> -> <name>
> ->      <firstName>...</firstName>
> ->      <lastName>...</lastName>
> -> </name>
> ->
> -> Question is: Can I somehow define a mapping, where I can say
> -> that the <name>
> -> element should be simply ignored?
> ->
> -> Thanks for advice!
> -> Peter Fuhrmann
> ->
> -> -----------------------------------------------------------
> -> 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

----------------------------------------------------------- 
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