The following table lists and describes the differences in behaviors of XSLT between versions.
Table A-5 Differences in behaviors of XSLT (Comparing version 06-00 and version 07-00 and later versions)
No. | Condition | Cosminexus XML Processor operations | |
---|---|---|---|
In version 06-00 | In version 07-00 and later versions | ||
1 | When the default error listener in the Transform and TransformerFactory classes is used | Throws an exception when an error occurs. | Does not throw an exception when an error occurs. |
2 | When you execute the newTransformer(Source source) and newTemplates methods in the TransformerFactory class | There is no difference between the versions. If there are errors in the stylesheet from which these methods are read, an error is reported to the fatalError method for the ErrorListener. In such a case, note that the return value from the newTransformer(Source source) and newTemplates methods might be null if the fatalError method implementation for the ErrorListener does not throw the TransformerException. The default ErrorListener does not throw the TransformerException. Therefore, to maintain normal behavior when an unrecoverable error occurs, Hitachi strongly recommends that you register the ErrorListener to throw the TransformerException from within the fatalError method. | |
3 | When XML is output to a file, if indent="yes" is not specified for the xsl:output element or the setOutputProperty(OutputKeys.INDENT, "yes") method of the Transform class is not executed | A linefeed is output immediately after the XML declaration. | Linefeed is not output. |
4 | When the transformation result is output in HTML format | The linefeed output between elements differs, however, as the linefeed between elements has no meaning in the HTML document, there is no problem. | |
5 | When you execute the system-property('xsl:version') function | The result is 1. | The result is 1.0. |
6 | If the content of the xsl:attribute element is a string including a tab | The attribute value of the result is a tab character itself. | The attribute value of the result is a character reference (	). |
7 | If you use the generate-id() function for the value attribute of the xsl:number element | 0 is output. | NaN is output. |
8 | If the prefix defined in the namespace declaration for the xsl:stylesheet element is not used in the elements created by the xsl:element element | The namespace declaration is output to the xsl:element element. | The namespace declaration is not output to the xsl:element element. |
9 | If you describe a top-level element in the simplified stylesheet where you specify 1.1 for the xsl:version attribute | In the forward compatible processing, the top-level element is instantiated and then transformed. | The forward compatible processing of the top-level element is ignored. |
10 | If you specify a non-existent attribute set name for the use-attribute-sets attribute of the xsl:attribute-set element | An error does not occur. | An error occurs indicating that the attribute set does not exist. |
11 | If neither the name attribute nor the match attribute is specified for the xsl:template element | An error does not occur. | An error occurs indicating that either the name or the match attribute is necessary. |
12 | If the excluded namespace prefixes that are specified in the exclude-result-prefixes attribute are not defined in the namespace declaration for the xsl:stylesheet element | An error does not occur. | An error occurs. |
13 | If you specify a value other than a number for the version attribute of the xsl:stylesheet element | An error does not occur. | An error occurs. |
14 | If you specify xml for the method attribute and a value other than 1.0 and 1.1 for the version attribute of the xsl:output element | A warning is not issued. | A warning is issued indicating that 1.0 is assumed. |
15 | When a character, which cannot be represented in the encoding used for output, is output in text output | The character is unreadable. | A warning is output to the standard error output and the corresponding character is output as a character reference. |
16 | If you specify an empty Source for the xmlSource argument of the transform(Source xmlSource, Result outputTarget) method in the Transform class | An error occurs. | The empty document generated with the newDocument method of the DocumentBuilder class is used. |
17 | If you specify null for the argument of the getFeature method in the TransformerFactory class | false is returned. | NullPointerException occurs. |
18 | When there is a prefix without a namespace declaration | The TransformerException exception occurs. | The XPathStylesheetDOM3Exception exception might occur. This exception is a subclass of the TransformerException exception and can be caught by TransformerException. |
19 | If you specify null for the f argument of the StreamResult(File f) constructor in the StreamResult class and the setSystemId(File f) method | The NullPointerException exception occurs. | The RuntimeException exception occurs. However, the NullPointerException exception occurs in Java SE 6. |
20 | If the named template specified in the name attribute for the xsl:call-template element does not exist (For details on the messages, see 11. KECX (Messages Output by Cosminexus XML Processor) in the manual uCosminexus Application Server Messages) | The KECX02019-E error is reported. | The KECX02019-E and KECX02015-E errors are reported. |
21 | Result of evaluation for an XPath expression that includes namespace::local-name | The namespace URI is resolved by considering the local name a prefix, and then the result of evaluation is the namespace node that has the string value matching with the namespace URI. | The result of the evaluation is the namespace node that has the specified local name. |
22 | When an inappropriate value is specified in the encoding attribute of the xsl:output element | The KECX02322-W warning is reported. | The KECX04196-W and KECX02322-W warnings are reported. |
23 | When the xsl:variable element contains both the select attribute and the element details | The KECX02288-E error is reported. | The KECX02019-E and KECX02288-E errors are reported. |
24 | When the value of the version attribute of the xsl:stylesheet element is 1.1 or more, and an inappropriate attribute is specified in the style sheet | An error occurs. | An error does not occur. |
25 | When the node specified in the name attribute does not exist during the generation of the processing command | The StringIndexOutOfBoundsException exception occurs. | An exception does not occur. |
26 | When the following sources are specified in the Source specification of the transform method:
| The NullPointerException exception occurs. | An exception does not occur. |
27 | When a style sheet with an invalid XSLT namespace declaration is entered as described below:
| The KECX02009-E error is reported. | The KECX02518-E error is reported. |
28 | When both the following conditions are satisfied:
| HTML is specified in upper case in the generated DOCTYPE declaration. | html is specified in lower case in the generated DOCTYPE declaration. |
29 | When the method attribute of the xsl:output element is xml, and 1.1 is specified in the version attribute | Version="1.0" is output in the XML declaration of the output XML document | version="1.1" is output. |
30 | When <xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="#default"> is defined in the style sheet, and the default namespace is not specified | error is invoked, and NullPointerException occurs as an exception resulting in the TransformerException exception. | error and fatalError are invoked, and the KECX02257-E error is reported. |
Table A-6 Differences in XSLT operations (Comparing version 08-50 and version 08-70)
No. | Condition | Cosminexus XML Processor operations | |
---|---|---|---|
In version 08-50 | In version 08-70 and later versions | ||
1 | If XMLEventReader acquired by using the XMLInputFactory.createXMLEventReader() method is specified in the StAXSource constructor argument, and is used as an input source for the Transformer.transform() method | The processing command outside the root element of the input XML document is ignored. | The processing command outside the root element of the input XML document is also transformed. |
2 | When both of the following conditions are satisfied:
| An error occurs during transformation or the transformation results are invalid. | Processed normally. |
3 | When both the following conditions are satisfied:
| The output results of sorting are different in J2SE 5.0 and Java SE 6. |
|
4 | When the output method is xml, and the characters that cannot be expressed with the specified output encoding are output | The output results might differ in J2SE 5.0 and Java SE 6. |
|