开发者

Android Converting objects to XML and vice versa

I created a xsd and I created Java objects using Castor. Then I imported this in my Android project and tried to build an XML from the object, using the marshal method.

Marshaller.marsh开发者_如何学Pythonal(v, writer);

I received some wired exception trouble processing "javax/xml/parsers/DocumentBuilder.class":...

So my question is Can I use Castor inside Android, If yes how can I work around this.

If no, what is the neat solution available to convert object to xml and xml to object in Android, similar to Castor.

Thanks in Advance.


I personally do not have any experience with Castor but from the website it would seem that it has dependencies which android does not support and therefore cannot be used inside android.


I ended up using Simple xml from simple.sourceforge.net/home.php. This looks light suitable for Android. But this will not create Java objects for your xsd. You have to create them on your own. Is there a way to build these objects directly from xsd compantible with Android?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜