Hello Gurus,

Need your help regarding unmarshalling and whitespaces.

I spent quite some time on this issue and tried following advices in earlier posts, but in vain.

I have the following xml:

<categories>
        <category label='Male Female'/>
        <category label='Sports'/>
</categories>


I try to unmarshal that using the following mappings:

<field name="columnHeaders" collection="arraylist" type="string">
<bind-xml name="label" location="categories/category" node="attribute"/>
</field>  

However the columnHeaders arrayList comes up with 3 elements ['Male', 'Female', 'Sports'] instead of just two ['Male Female','Sports']


After the creating the Unmarshaller I do make sure preserveWhitespace is set to 'true'
    unmarshaller = context.createUnmarshaller();
    unmarshaller.setWhitespacePreserve(true);

But this does not help.

I also tried adding "xml:space='preserve'" in the <category> node above. No luck.

I am running out of ideas. Some one please guide.

I am using castor 1.3

Thanks.
Mihir.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to