Exactly! I updated my code based on your suggestion and it worked like a charm. It looks just like what you demonstrated above. I really appreciate the information you provided.
Side Note: The one thing that I noticed (that was a little annoying from the Cache perspective) is my XML Export uses the XMLNAME keyword values, but the JSON Export does not.
Here is an example of my real property names from the Slide class with the XMLNAME keyword values:
Property SlideSequence As %Integer(XMLNAME = "slideSeq");
Property BarcodeText As %String(MAXLEN = 100, XMLNAME = "barcodeID");
Property StainType As %String(MAXLEN = 200, XMLNAME = "stainType");
Property StainTypeMapped As %String(MAXLEN = 200, XMLNAME = "mappedStainType");
Property Block As %String(XMLNAME = "blockNumber");
The XML Export uses the XMLNAME value. But the JSON Export uses the class property name. I looked in the documentation to see if there was a JSONNAME keyword - but no luck. So that is a little nuance and inconsistency with Cache. I like how we can encapsulate the real property name with an alias using XMLNAME (we use the XMLNAME mainly for downstream systems, and to keep the real property names hidden (for lack of a better word) in the projected data formats). But at least you got me to where I needed to be. So you are the Cache Developer Community Hero of the Week - at least for me :)
Best Regards and GO TEAM!
Wow! Thank you for the timely reply. I will go and try that right now. If that works, then you will be my hero! I wasted several hours over the past few days trying a bunch of different things and looking for some secret hidden feature such as a keyword like XMLKEYNAMEASELEMENT = 1 or something like that where the built-in Cache code might have allowed XML attributes to be instead exported as an element (which would have been a really cool hidden feature if it existed). But I will definitely try your suggestion today.
This is why I like the InterSystems Developer Community so much. There are folks like you who have many years of knowledge and experience, as well as, those who have run into similiar issues, so all of you always have so many wonderful ideas, thoughts, and suggestions to help fellow Cache programmers.
Thanks again for your time and advice. Go Team!!!!
Thanks Enrico. I look forward to being able to use the new features of Cache and IRIS someday. The company I work for is still running Cache 2017.1.3, so those new JSON features are not available. But I sincerely appreciate the information. Because once we upgrade to IRIS, then I will be able to leverage/use the information you shared.
Best Regards!