[Stackoverflow] [Progress OpenEdge ABL] Using XSD to generate ProDataSet, populate manually, then use ProDataSet to create XML

Not open for further replies.

Frank Sandbeans

I have recently discovered the ProDataSet and the things it can do with XML. At a high level, I'm trying to use a 3rd party XSD document to dynamically create a ProDataSet via READ-XMLSCHEMA, populate that ProDataSet, and then use WRITE-XML to dump that data back out into a structured XML file, using the relationships and attributes imported in the first step. This would be a huge time saver if all I have to do is map my internal data to the ProDataSet and let it handle the XML generation.

The problem I'm encountering is that my actual DB structure is nothing close to the structure defined in the XSD. Table names, field names, relationships, etc. are all different. In theory, it would be fairly simple to use my internal data to manually populate the ProDataSet, but I cannot seem to get this "mapping" portion to work and I'm starting to think my main concept isn't possible.

I feel like I've tried everything, but my latest iteration is using the imported ProDataSet to dynamically create temp tables with the exact same structure using ADD-LIKE-FIELD. I'm able to then manually create temp table records with BUFFER-CREATE and can map my internal DB to the ProDataSet structure. In theory, I'm able to define the ProDataSet sources with ADD-SOURCE-BUFFER and ATTACH-DATA-SOURCE, but the relationships are not carrying over with FILL() and dumping the XML only outputs the parent element without any of the child records. I'm not sure I'd like to focus on this solution, as I feel like it's the long way around the block, but it is my most successful thus far.

  1. Am I barking up the wrong tree?
  2. If not, does anyone have a top-to-bottom example of doing something like this? I've been trying to piece together the concepts from various sources, but I cannot find anything that is comprehensive. Every example is working on the premise that the ProDataSet mimics your existing DB structure (which I understand).

Continue reading...
Not open for further replies.