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.3 columnRule

mark1Description

This tag specifies rules relating to column elements.

mark1Format

<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.

mark1Attributes

[Table L-3 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 columnRule tag (*2).
Either the colname attribute or the colno attribute must be specified.

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.
Either the colname attribute or the colno attribute must be specified.

Conditional

tagname

Specifies the name of the XML tag converted by the columnRule tag.
If the tagname attribute is not specified, the column names in the results table are used as tag names (*2).
If spaces ("") are specified as the value of this attribute, the opening and closing columnRule tags will not be output.

Conditional

parent

Specifies the mapping rule identifier for the parent rule that is the parent of the columnRule tag. This attribute must be set.
Also, the parentRule tag with the mapping rule identifier specified by this attribute must be defined before defining the columnRule tag that is specified.

Required

hide

Specifying this attribute as "yes" will prevent the element corresponding to the columnRule tag from being output as XML documents.
This attribute does not need to be set if the element corresponding to the columnRule tag is to be output as XML documents.

Optional

null

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

  • empty:
    Outputs the column element as an empty element.
  • omit:
    Omits the column element.

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 in the "handler-arg" attribute the character code and the data type to be converted. 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
    For the data type, specify either of the following as the format of the data that is to be converted to the character code:
    • TEXT:
      Specify this value to treat the data as text when generating the output XML .
      Entity reference conversion processing (*3) will be performed.
    • XML:
      Specify this value to treat the data as XML when generating the output XML.
      Entity reference conversion processing will not be performed.
      If this value ("XML") is specified, the data stored in the column of the results table must be data in XML format. Note that XML declarations, DOCTYPE declarations, and DTD descriptions cannot be included.
  • Character code
    For the 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-4 XML Tags]

Entity reference

Symbol represented

&lt;

<

&gt;

>

&amp;

&

&apos;

'

&quot;

"

mark1Elements

None

mark1Note on the columnRule Tag


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006