Hello everybody,

I'm a bit stuck on the following problem:

<root>
<Element tag="this">
<Address>[EMAIL PROTECTED]</Address>
</Element>
<Element tag="that"> <Server>yet.another.server.com</Server>
<Login>login</Login>
<Password>password</Password> </Element>
</root>


When an Element has a tag "this" it should contain only the Address element. When "that" is encountered, the child elements have to be Server, Login and Password. I'm stuck with the mapping: Castor relies on the name of the element (Element in this case) to determine what to do with it - I need to rely on a certain combination (the name Element and the tag) - can this be done with Castor? If so, could someone kick me in the right direction?

Hmm... It seems I was trying to solve a problem that does not exist. It isn't a problem to create a class Element with fields address, login and password. If a field is null, Castor will ignore it. I can place some logic in my code that check the tags in my objects, and set the unnecessary values to null...


Ah well :o)



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

Reply via email to