Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX -
Contents Index PreviousNext

Appendix L XML Conversion Function Mapping Rules> L.3 Mapping Rule Conversion Examples

L.3.6 Extracting Column Names as Attribute Values

The following example shows how to extract XML documents by using column names as attribute values.

Results Table

The following mapping rule generates XML documents by using the specified column of the results table directly as the attribute value of a particular tag.
This mapping rule also shows how to make the following fixed assignments:

Mapping Rule

<?xml version= "1.0"?>
<MappingRule>
<parentRule id="p1" tagname="PERSON" />
<columnRule id="c1" colname="A" tagname="NUM" parent="p1" />
<extensionRule id="e1" attrname="name" attrof="c1" extender="STATIC" extender-arg="A" />
<attributeRule id="a1" colname="B" attrname="value" attrof="c1" />
<columnRule id="c2" colname="D" tagname="NAME" parent="p1" />
<extensionRule id="e2" attrname="name" attrof="c2" extender="STATIC" extender-arg="D" />
<attributeRule id="a2" colname="C" attrname="value" attrof="c2" />
<columnRule id="c3" colname="E" tagname="JOB" parent="p1" />
<extensionRule id="e3" attrname="name" attrof="c3" extender="STATIC" extender-arg="E" />
<attributeRule id="a3" colname="F" attrname="value" attrof="c3" />
</MappingRule>

This mapping rule outputs the following XML document:

[Figure L-8 XML Output Data]


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006