It needs to be the root element of the class mapping, so the field attribute won't work. I *won't* need to unmarshall the information, if that helps.

Another question to sidetrack the thread: Is there a way to tie either tie a physical schema file to a castor mapping instance or include schema type information in the castor mapping file? I'd like to be able to determine the schema type of each mapped class programmatically in order to help generate valid WSDL using castor and that requires knowing the mapped schema type of a Java class. The 'xml' attribute in the 'map-to' element is the closest thing I can find, but that is the actual xml element name for mapping, not the schema type. Any ideas?

Thanks,
Adam

Stephen Bash wrote:

Adam-

One thing that might be of help is the container attribute of the field element. Setting container="true", I believe, causes Castor to not create an element for the field, and only marshal the internal objects. If you're looking only at the root element of the document, I'm not sure what can be done. Do you need to unmarshal this information at anytime? There might be ways of going one-way if you don't need the reverse operation.

HTH,
Stephen


Adam Kramer wrote:

Greetings all,

I have a need to marshal an object without its outer element. For instance, if I marshalled a person object that had two properties of name, gender, it would be marshalled like:
<name>bob foobar</name>
<gender>male</gender>

without the outer <person> tag. The need arises from using castor with a web service framework that starts the outter element, then uses castor to marshal the fields inside the type.

I noticed you can use setRootElement in the marshaller, but I don't believe this allows you to set it to null.

Thanks,
Adam

-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------



-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------



-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to