4.5 How to use the properties of the Shift_JIS switch function

To use the Shift_JIS switch function, you need to set the following property defined independently by Cosminexus XML Processor.

[Figure]

Set a character encoding as the property value. The following table lists the property values to set and their meanings.

Table 4-5 Property values to set and their meanings

Value set in the property#1Meaning
SJISApplies the SJIS encoding.
MS932Applies the MS932 encoding.
Any other character stringIgnores the specification.#2
#1
The specified character string is not case-sensitive.
#2
If the specification is ignored, the last specified encoding is valid.
Note
If the Shift_JIS switch function is not specified, the default encoding is SJIS.

The Shift_JIS switch function property needs to be set for each instance of the classes and interfaces shown below. The following table lists the methods for setting the Shift_JIS switch function. This table lists the methods to use for setting the properties for each class and interface.

Table 4-6 Methods for setting the Shift_JIS switch function

Class and interfaceMethod
javax.xml.parsers.DocumentBuilderFactorysetAttribute
javax.xml.parsers.SAXParsersetProperty
org.xml.sax.XMLReadersetProperty
javax.xml.parsers.TransformerFactorysetAttribute

The following subsections describe the cases in which to use the Shift_JIS switch function for the DOM parser, SAX parser, and XSLT transformer.

Organization of this section
4.5.1 How to Use the Shift_JIS Switch Function for the DOM Parser
4.5.2 How to Use the Shift_JIS Switch Function for the SAX Parser
4.5.3 How to Use the Shift_JIS Switch Function for the XSLT Transformer