Re: [Simple-support] Does SimpleXML have its own version of 'XJC'?
Brought to you by:
niallg
|
From: dennis <de...@li...> - 2014-04-29 12:41:07
|
Hi Roger, Some time ago I posted a sed script to convert the java classes output of xjc to something that works with SimpleXML. I have attached the scripts in case you or anyone else is interested. I made some updates during my conversations with Kyle and others. I didn't keep up with new Simple developments for a while, so new concepts may need some fidling. See: http://sourceforge.net/p/simple/mailman/message/29161101/ The script works as follows (tested on Ubuntu Linux some time ago): - generate source with xjc: xjc XMLSchema.xsd - jaxb2simple.sed generated/JAXBSource.java > src/generated/SimpleSource.java - or in batch with the rewrite script: NAMESPACE=generated cd $NAMESPACE for i in *.java ;do ../../rewrite.sh $i ../$NAMESPACE/ddi/$i ;done The generated code can now be used on android with simple. Some things may need to be fixed, since I didn't test yet with an XSD covering all concepts, and because simpleframework defaults to require all elements (opposed to jaxb). Expect fixes for emply lists, and enumerations of strings (Android does not seem to return valueOf correctly when casing of remaining letters does not match enum name). Kind regards, Dennis * Roger Lee <Ro...@L2...> [700101 01:00]: > Been using JAXB to test some XML parsing. Now I need to deploy the > solution to an Android App. Does SimpleXML have or recommend a tool to > generate the Java Classes from an Marshaling similar to the JDK's XJC? > TIA |