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.1 Mapping Rule File Definition Format |
This tag specifies rules relating to column elements.
<columnRule id="attribute value" { colname="attribute value" | colno="attribute value" } tagname="attribute value" parent="attribute value" hide="attribute value" null="attribute value" handler="attribute value" handler-arg="attribute value" /> |
Note: Specify either the 'colname' or the 'colno' attribute.
Attribute name |
Description |
Required item? |
---|---|---|
id |
Specifies the mapping rule identifier (*1). |
Required |
colname |
Specifies the name of the column in the results table that is to be extracted as the element of the columnRule tag (*2). |
Conditional |
colno |
Specifies the number of the column in the results table to be extracted as the element of the columnRule tag. Elements are extracted from the column specified in this attribute. Specify an integer starting from 1. |
Conditional |
tagname |
Specifies the name of the XML tag converted by the columnRule tag. |
Conditional |
parent |
Specifies the mapping rule identifier for the parent rule that is the parent of the columnRule tag. This attribute must be set. |
Required |
hide |
Specifying this attribute as "yes" will prevent the element corresponding to the columnRule tag from being output as XML documents. |
Optional |
null |
Specifies the format used to output the element if the column value in the results table is null.
If this attribute is not specified, the default value is "empty". |
Optional |
handler |
If the data stored in the column of the results table is binary data, it will be converted to the appropriate character code and output as XML documents. |
Optional |
handler-arg |
This attribute is enabled when "BINARYDATA" is specified in the 'handler' attribute. It specifies the character code for the data stored in the column of the results table, and the type of data that will be converted from binary to this code.
If this attribute is not specified, the default values are "TEXT" for the data type and "UTF-8" for the character code. |
Optional |
*1) 'Mapping rule identifiers' are used to identify mapping rules. Each identifier must be unique within a mapping rule file.
*2) When converting from a CSV file, the CSVSource class setFirstRecordToColumn() method can be used to handle the data in the first row as column names.
*3) The entity references that can be used with the XML conversion function are as follows:
Entity reference |
Symbol represented |
---|---|
< |
< |
> |
> |
& |
& |
' |
' |
" |
" |
None
Example:
In the following example, an error will occur because both 'colname' and 'colno' attributes are used in the same mapping rule file.
<columnRule id="c1" colname="A" tagname="NUM" parent="p1" /> <columnRule id="c2" colno="2" tagname="NAME" parent="p1" />
Example:
In the following example, the same tagname attribute value is specified for two different columns in the results table, so no error will occur.
<columnRule id="c1" colno="1" tagname="foo" parent="p1" /> <columnRule id="c2" colno="2" tagname="foo" parent="p1" />
Example 1:
In the following example, an error will occur because the same tagname attribute value is specified for the same column in the results table.
<columnRule id="c1" colno="1" tagname="foo" parent="p1" /> <columnRule id="c2" colno="1" tagname="foo" parent="p1" />
Example 2:
In the following example, different tagname attribute values are specified for the same column in the results table, so no error will occur.
<columnRule id="c1" colno="1" tagname="foo" parent="p1" /> <columnRule id="c2" colno="1" tagname="var" parent="p1" />
Contents
Index
![]() ![]() |