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.1 Mapping Rule File Definition Format

L.1.4 attributeRule

mark1Description

This tag specifies rules for converting column values in the XML documents to attributes.

mark1Format

<attributeRule id="attribute value" { colname="attribute value"| colno="attribute value" }
 attrname="attribute value" attrof="attribute value" null="attribute value" handler="attribute value"
 handler-arg="attribute value" />

Note: Specify either the colname attribute or the colno attribute.

mark1Attributes

[Table L-5 Attributes]

Attribute name

Description

Required item?

id

Specifies the mapping rule identifier (*1).
This attribute must be specified.

Required

colname

Specifies the name of the column in the results table that is to be extracted as the element of the attributeRule tag.
Either the colname attribute or the colno attribute must be specified.

Conditional

colno

Specifies the number of the column in the results table that is to be extracted as the element of the attributeRule tag.
Specify an integer starting from 1.
Either the colname attribute or the colno attribute must be specified.

Conditional

attrname

Specifies the attribute name for the attributeRule tag. If the value of this attribute is not specified, the column name in the results table will be set as the attribute value(*2).
Spaces ("") cannot be specified as the value of this attribute.

Required

attrof

Specifies the mapping rule identifier for the column rule specified in the attributeRule tag.
This attribute must be set.

Required

null

Specifies the format used to output the attribute if the column value is null.
Either of the following values can be specified:

  • empty:
    Outputs the column value as a space("").
  • omit:
    Omits the column value.

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.
Specify "BINARYDATA" in this attribute if the column data in the results table is binary data, and specify the character code and the data type to be converted in the 'handler-arg' attribute. This attribute does not need to be specified if the column data in the results table is not binary data.

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.
Separate the data type and the character code by a comma.

  • Data type
    To treat the data as text when generating the output XML, specify "TEXT" as the data type.
    Entity reference conversion processing (*3) will be performed.
  • Character code
    For character code, specify the name of a Java character code. The value specified here will be passed to the various Java methods that require the name of a Java character code as an argument.

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:

[Table L-6 XML Tags]

Entity references

Symbol represented

&lt;

<

&gt;

>

&amp;

&

&apos;

'

&quot;

"

mark1Elements

None

mark1Note on the attributeRule Tag


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006