Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX - |
Contents
Index
![]() ![]() |
Appendix L XML Conversion Function Mapping Rules | > L.3 Mapping Rule Conversion Examples |
The following example shows how to extract XML documents that has multi-level tag structures based on consolidation.
Results Table
The following mapping rule extracts data from the specified column of the first row in the results table, uses it as the element for the PERSON tag, and then repeats this process for each row in the results table. However, records with the same value for columns A, B, and C are consolidated in the resulting XML output.
Mapping Rule
<?xml version= "1.0"?> <MappingRule> <parentRule id="p1" tagname="PERSON" controller="KEY" controller-arg="c1,c2,c3"/> <columnRule id="c1" colname="A" tagname="NUM" parent="p1"/> <columnRule id="c2" colname="B" tagname="NAME" parent="p1"/> <columnRule id="c3" colname="C" tagname="JOB" parent="p1"/> <parentRule id="p2" tagname="DETAIL" parent="p1"/> <columnRule id="c4" colname="E" tagname="LOCNUM" parent="p2"/> <columnRule id="c5" colname="F" tagname="LOC" parent="p2"/> </MappingRule> |
This mapping rule outputs the following XML document:
Contents
Index
![]() ![]() |