Focal Point
XML Adapter -- How do I resume specifying a segment?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/2341052592

August 12, 2008, 03:42 PM
John_Edwards
XML Adapter -- How do I resume specifying a segment?
I have a master file for xml that needs to look like this --

SEGMENT=CLIENT, SEGTYPE=S0, PARENT=HIVFORM, $
FIELDNAME=CLIENT, ALIAS=Client, USAGE=A1, ACTUAL=A1,
REFERENCE=HIVFORM, PROPERTY=ELEMENT, $
FIELDNAME=PERSONID, ALIAS=personId, USAGE=A10, ACTUAL=A10,
REFERENCE=CLIENT, PROPERTY=ELEMENT, $
FIELDNAME=BIRTHYEAR, ALIAS=birthYear, USAGE=YY, ACTUAL=A10,
MISSING=ON,
REFERENCE=CLIENT, PROPERTY=ELEMENT, $
FIELDNAME=STATEOFRESIDENCE, ALIAS=stateOfResidence, USAGE=A10, ACTUAL=A10,
MISSING=ON,
REFERENCE=CLIENT, PROPERTY=ELEMENT, $
FIELDNAME=ETHNICITY, ALIAS=ethnicity, USAGE=A10, ACTUAL=A10,
MISSING=ON,
REFERENCE=CLIENT, PROPERTY=ELEMENT, $

SEGMENT=RACES, SEGTYPE=S0, PARENT=CLIENT, $
FIELDNAME=RACES, ALIAS=races, USAGE=A1, ACTUAL=A1,
REFERENCE=CLIENT, PROPERTY=ELEMENT, $
SEGMENT=RACE, SEGTYPE=S0, PARENT=RACES, $
FIELDNAME=RACE, ALIAS=race, USAGE=A1, ACTUAL=A1,
REFERENCE=RACES, PROPERTY=ELEMENT, $
FIELDNAME=RACEVALUECODE, ALIAS=raceValueCode, USAGE=A10, ACTUAL=A10,
REFERENCE=RACE, PROPERTY=ELEMENT, $
FIELDNAME=RACEID, ALIAS=raceId, USAGE=A1, ACTUAL=A1,
MISSING=ON,
REFERENCE=RACE, PROPERTY=ATTRIBUTE, $

FIELDNAME=CURRENTGENDERVALUECODE, ALIAS=currentGenderValueCode, USAGE=A10, ACTUAL=A10,
MISSING=ON,
REFERENCE=CLIENT, PROPERTY=ELEMENT, $
FIELDNAME=OTHERCURRENTGENDER, ALIAS=otherCurrentGender, USAGE=A15, ACTUAL=A15,
MISSING=ON,
REFERENCE=CLIENT, PROPERTY=ELEMENT, $
FIELDNAME=BIRTHGENDERVALUECODE, ALIAS=birthGenderValueCode, USAGE=A10, ACTUAL=A10,
MISSING=ON,
REFERENCE=CLIENT, PROPERTY=ELEMENT, $

Note that the RACES segment is in the middle of the CLIENT segment -- the last three fields specified belong to the CLIENT parent, not RACES or its children. When I run DM against this those last three fields do not appear -- they are ignored.

How do I get DM to pick up where it left off on the CLIENT segment? Is there a way to separate the fields defined for a specific segment into two different locations, and have them process properly to the output? What this essentially means ins that any individual elements in the xml that follow a structure are lost -- an exceptionally common occurrence in xml specifications.

J.

This message has been edited. Last edited by: John_Edwards,



August 14, 2008, 09:34 AM
John_Edwards
"WILL NO ONE RID ME OF THIS MEDDLESOME PRIEST???"

-- Henry II



August 15, 2008, 12:50 PM
j.gross
Are you coding this manually? Why? I would start with the synonym that iWay generates, let iWay reflect the xml structure in Focus terms, and then modify field formats as needed.

I don't think the order of declaration of FIELDs in the MFD is expected to match that in the xml declarations. Basically, an MFD lists the structure breadth-first, whereas DTD may go depth-first. A segment should account for all items that occur togather at a given level, ignoring "interruptions" for describing its descendents.


- Jack Gross
WF through 8.1.05
August 15, 2008, 03:12 PM
John_Edwards
I have made modifications to the master file so that it can function properly for the writing of xml data. In its current state the auto-generator for xml master files does not produce a result that successfully runs in Data Migrator. The order of declaration of FIELDS in the MFD is very tightly bound to the order of output in the xml result. Changing the order in the master file results in an exact change to the xml that is produced by the processor, regardless of the ordering of the fields in Data Migrator. The order in Data Migrator has no effect on the xml output in any way -- all ordering is driven by the master file. Indeed a segment should account for all items that occur together at a given level, ignoring interruptions, but it does not -- that is exactly the problem that I am having. In the event that there is a segment interrupting the current level it results in all following fields disappearing from the output. That is the problem I am attempting to address with this entry into the forums. J.

I owe you a beer, but not for the reason you may think. The hand-crafted master file I show above worked correctly for 7.6.1, but not for 7.6.5 which I recently upgraded to. But! you got me to realize that in the hand-craft process performed previously I had made several additional changes (other than hierarchical structure) that could conceivably be made to the 7.6.5 version of the auto-generated master file. That is, I needed a hybrid of my existing version and the new version the I-Way produces on its own.

When I took the time to correct the field formats and Access_Property items that were poorly formed I was able to produce a correct result.

Yippee!

Thank you very much for taking the time to respond -- your choice of words seemed to miss the mark at first, but upon reconsideration pointed right at the heart of my problem.

Fixed this crisis one hour before going on vacation too. What a deal!

J.



August 17, 2008, 07:42 PM
j.gross
Glad to be of help. Enjoy!

(We can discuss delivery options for the brew when you return.)

-jg


- Jack Gross
WF through 8.1.05