Hello to my fellow Cache Gurus:
I ran into two issues with Cache to XML Export and Cache to JSON Export in regard to array sequences. So before I waste time opening a WRC ticket, I figured I would poll the Development Community, since there is always so much wonderful feedback and suggestions via this Developer Community! So much thanks in advance for everyone's input! Go Team!
I have multiple classes that extend from %RegisteredObject and %XML.Adaptor. These classes are populated with data from our application and the data of the overall class structure is exported as XML (and soon to be JSON) format. And the XML export (and even JSON export) works very well, except for one small issue.
For a couple of the classes, there is a property that is defined as an array of another class. Example: Property Slides As array Of Q.Interface.Fragment.IMS.Slide;
When the objects in the array get exported to XML they show up with an attribute such as this:
<slide slideSeq="1">
// other property values show here
</slide>
<slide slideSeq="2">
// other property values show here
</slide>
How can I get rid of that attribute? Or is there a way to instead have the attribute export as an element?
When I try to output the data as JSON it is even worse. The attribute name is tossed away as well as the object name (slide) and only the sequence number value is included.
Here is an example of the JSON:
"1": {
// other property values show here
},
"2": {
// other property values show here
},
I have no clue how to get the JSON to export properly with maintaining the object name (slide) like shown for the XML and suppressing the sequence value.
Thank you all!