Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Custom formatting of XML export

$
0
0
I export a list of elements based in example:
http://www.smartclient.com/smartgwtee/showcase/#custom_export

and I get the following output in XML:
Code:

<List>
  <Object>
    <Impact>data interrupted</Impact>
    <Subject>eclipse-season</Subject>
    <Type>Planned Maintenance</Type>
    <End Time>2014-09-29T22:00:00</End Time>
    <Satellites>MET-7</Satellites>
  </Object>
  <Object>
    <Impact>data interrupted</Impact>
    <Subject>eclipse-season</Subject>
    <Type>Planned Maintenance</Type>
    <End Time>2014-09-29T22:00:00</End Time>
    <Satellites>MET-7</Satellites>
  </Object>
</List>

However, I would like to get something more like:

Code:

<announcements>
  <announcement Impact="data interrupted" Subject="eclipse-season" Type="Planned Maintenance">
    <End Time>2014-09-29T22:00:00</End Time>
    <Satellites>MET-7</Satellites>
  </announcement>
  <announcement Impact="data interrupted" Subject="eclipse-season" Type="Planned Maintenance">
    <End Time>2014-09-29T22:00:00</End Time>
    <Satellites>MET-7</Satellites>
  </announcement>
</announcement>

That is, how do I:
1) change "List" to a value defined by me: "announcements"
2) change "Object" to a value defined by me: "announcement"
3) change elements into attributes, from instance Impact. This would be the equivalent as using annotations @XmlAttribute, @XmlElement

Is 3) possible at all? Or should I look into another way to implement the XML formatting different from the example above.

Thanks in advance,

Viewing all articles
Browse latest Browse all 4756

Trending Articles