Discussions

XML & Web services: Castor Marshalling- To generate Empty tag for unpopulated fields

  1. Hi All, I am trying to marshall a java class to XML using CASTOR (castor-1.0M2.jar). If the value of a field in java object is null, then Castor does not generate an empty tag for that field in XML. It simply ignores that field and generates xml content for the next non-null field. Is there a way to overirde this behaviour? It would otherwise result in invalid XML (w.r.t XSD). Thanks, Dinesh
  2. Make sure the object.toString() Method returns "" empty string.
  3. Hi dinesh, I am also having the same problem. Did you get any solution? Hi Biswa Das, Is there any other solution?