Re: [Simple-support] Namespace printed after attributes specified in Order annotation
Brought to you by:
niallg
|
From: Faisal S. <fai...@gm...> - 2012-03-03 12:39:21
|
Okay. Thanks for the quick response. Regards Faisal On Sat, Mar 3, 2012 at 2:18 PM, Niall Gallagher <gal...@ya...>wrote: > For now the only way would be to do it as you are doing now, or perhaps > use a Visitor, which would probably be overkill. Maybe this is something I > should take a look at for the next release, so that the @Order annotation > can include namespaces. > > --- On *Fri, 2/3/12, Faisal Siyavudeen <fai...@gm...>*wrote: > > > From: Faisal Siyavudeen <fai...@gm...> > Subject: [Simple-support] Namespace printed after attributes specified in > Order annotation > To: "simple-support" <sim...@li...> > Received: Friday, 2 March, 2012, 3:47 AM > > Hi, > > First of all, thanks for the excellent "Simple XML" library. > > I am trying to use it to serialize a class using the following annotations. > > @Root(strict = false, name = "oxml") > @Namespace(reference = "http://www.faisal.in/testschema") > @Order(attributes = {"app", "os" }) > public class OnXml { > > .... > > } > > Unfortunately, the generated namespace attribute (xmlns) is printed > after the attributes specified in the @Order annotation. How can I > ensure that the namespace is printed ahead of these attributes? > > I tried adding "xmlns" to the @Order list, but then the code expects > xmlns to be declared as a class member. > > I finally made it work by adding xmlns as a class member initialized > to the namespace string and including it inside @Order. > > Is there a better way to do this? > > Regards > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Simple-support mailing list > Sim...@li...<http://mc/compose?to=...@li...> > https://lists.sourceforge.net/lists/listinfo/simple-support > > |