Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX - |
Contents
Index
![]() ![]() |
Part 3 Other Application Developments | > Chapter 12 XML Conversion Function |
This section describes the CSV formats that are supported by the XML conversion function.
The data between the delimiter characters is handled as 1 data.
Refer to K.2.3 setDelimiter for more information on the characters that can be specified as delimiter characters.
If the quotation marks are specified, both CSV data with and without quotation marks can be used.
Refer to K.2.4 setQuote for more information on the characters that can be specified as quotation marks.
The blank characters (blank space, tab) in both ends of data will be deleted. It is necessary to enclose the data in quotation marks if the data contain a blank character.
The two methods shown below can be used to enter delimiter characters, quotation marks, and the backslash (\) as character data.
Select the method in accordance with the argument value specified in the setEnableEscapeChar() of the CSVSource class.
Enclose the data in quotation marks.
Enclose the data in quotation marks, and enter two consecutive quotation marks for a quotation mark character that is to be processed as data.
If a quotation mark character is entered partway through the data, the quotation mark character can also be entered provided that the data as a whole is not enclosed in quotation marks.
Enter the backslash (\) as is.
Enclose the data in quotation marks, or add a backslash (\) before the delimiter character.
Add a backslash (\) before the quotation mark character that is to be processed as data.
If a quotation mark character is entered partway through the data, the quotation mark character can also be entered provided that the data as a whole is not enclosed in quotation marks.
Add a backslash (\) before the backslash that is to be processed as data.
The example below shows how delimiter characters, quotation marks, and the backslash (\) are entered as data. (This example assumes that the comma (,) was specified as the delimiter character.)
Example
To enter $1,200, He said "Hello.", and \100 as data, enter these in the CSV file as follows:
- If the CSVSource class setEnableEscapeChar() argument value is "false":
"$1,200", "He said ""Hello.""", "\100"
- If the CSVSource class setEnableEscapeChar() argument value is "true" (*1)
"$1,200", "He said \"Hello.\"", "\\100"*1) Instead of "$1,200", $1\,200 can also be entered.
Linefeed characters (CR, LF, or CRLF) included in data that is enclosed in quotation marks are output to an XML document as is, even if the output destination is an attribute value or an element.
The linefeed characters (CR, LF, or CRLF) in data enclosed in quotation marks are not converted to character references (
 
).
From XML 1.0, if an XML document that includes linefeed characters is given to an XML processor, the linefeed characters are converted as follows:
Contents
Index
![]() ![]() |