Appendix A.5 Differences in Behaviors of XSLT Between Versions

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.ConditionCosminexus XML Processor operations
In version 06-00In version 07-00 and later versions
1When the default error listener in the Transform and TransformerFactory classes is usedThrows an exception when an error occurs.Does not throw an exception when an error occurs.
2When you execute the newTransformer(Source source) and newTemplates methods in the TransformerFactory classThere 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.
3When 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 executedA linefeed is output immediately after the XML declaration.Linefeed is not output.
4When the transformation result is output in HTML formatThe linefeed output between elements differs, however, as the linefeed between elements has no meaning in the HTML document, there is no problem.
5When you execute the system-property('xsl:version') functionThe result is 1.The result is 1.0.
6If the content of the xsl:attribute element is a string including a tabThe attribute value of the result is a tab character itself.The attribute value of the result is a character reference (	).
7If you use the generate-id() function for the value attribute of the xsl:number element0 is output.NaN is output.
8If the prefix defined in the namespace declaration for the xsl:stylesheet element is not used in the elements created by the xsl:element elementThe namespace declaration is output to the xsl:element element.The namespace declaration is not output to the xsl:element element.
9If you describe a top-level element in the simplified stylesheet where you specify 1.1 for the xsl:version attributeIn the forward compatible processing, the top-level element is instantiated and then transformed.The forward compatible processing of the top-level element is ignored.
10If you specify a non-existent attribute set name for the use-attribute-sets attribute of the xsl:attribute-set elementAn error does not occur.An error occurs indicating that the attribute set does not exist.
11If neither the name attribute nor the match attribute is specified for the xsl:template elementAn error does not occur.An error occurs indicating that either the name or the match attribute is necessary.
12If the excluded namespace prefixes that are specified in the exclude-result-prefixes attribute are not defined in the namespace declaration for the xsl:stylesheet elementAn error does not occur.An error occurs.
13If you specify a value other than a number for the version attribute of the xsl:stylesheet elementAn error does not occur.An error occurs.
14If 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 elementA warning is not issued.A warning is issued indicating that 1.0 is assumed.
15When a character, which cannot be represented in the encoding used for output, is output in text outputThe character is unreadable.A warning is output to the standard error output and the corresponding character is output as a character reference.
16If you specify an empty Source for the xmlSource argument of the transform(Source xmlSource, Result outputTarget) method in the Transform classAn error occurs.The empty document generated with the newDocument method of the DocumentBuilder class is used.
17If you specify null for the argument of the getFeature method in the TransformerFactory classfalse is returned.NullPointerException occurs.
18When there is a prefix without a namespace declarationThe TransformerException exception occurs.The XPathStylesheetDOM3Exception exception might occur. This exception is a subclass of the TransformerException exception and can be caught by TransformerException.
19If you specify null for the f argument of the StreamResult(File f) constructor in the StreamResult class and the setSystemId(File f) methodThe NullPointerException exception occurs.The RuntimeException exception occurs.
However, the NullPointerException exception occurs in Java SE 6.
20If 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.
21Result of evaluation for an XPath expression that includes namespace::local-nameThe 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.
22When an inappropriate value is specified in the encoding attribute of the xsl:output elementThe KECX02322-W warning is reported.The KECX04196-W and KECX02322-W warnings are reported.
23When the xsl:variable element contains both the select attribute and the element detailsThe KECX02288-E error is reported.The KECX02019-E and KECX02288-E errors are reported.
24When 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 sheetAn error occurs.An error does not occur.
25When the node specified in the name attribute does not exist during the generation of the processing commandThe StringIndexOutOfBoundsException exception occurs.An exception does not occur.
26When the following sources are specified in the Source specification of the transform method:
  1. DOMSource
    - When Node is not set with the setNode method in the DOMSource generated by a constructor without an argument
    - When Node specified in the constructor argument is null
  2. SAXSource
    - When InputSource is not set with the setInputSource method in the SAXSource generated by a constructor without an argument
    - When the InputSource specified in the constructor argument is null
The NullPointerException exception occurs.An exception does not occur.
27When a style sheet with an invalid XSLT namespace declaration is entered as described below:
Example
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/2199/XSL/Transform">
The KECX02009-E error is reported.The KECX02518-E error is reported.
28When both the following conditions are satisfied:
  • OutputKeys.DOCTYPE_SYSTEM is specified with the setOutputProperty method of the Transformer class
  • html is specified in OutputKeys.METHOD with the setOutputProperty method of the Transformer class
HTML is specified in upper case in the generated DOCTYPE declaration.html is specified in lower case in the generated DOCTYPE declaration.
29When the method attribute of the xsl:output element is xml, and 1.1 is specified in the version attributeVersion="1.0" is output in the XML declaration of the output XML documentversion="1.1" is output.
30When <xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="#default"> is defined in the style sheet, and the default namespace is not specifiederror 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.ConditionCosminexus XML Processor operations
In version 08-50In version 08-70 and later versions
1If 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() methodThe 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.
2When both of the following conditions are satisfied:
  • The elements in the input XML document for transformers belong to a non-XSLT namespace
  • Transformation is performed by using StAXResult created from XMLEventWriter
An error occurs during transformation or the transformation results are invalid.Processed normally.
3When both the following conditions are satisfied:
  • Transformation is performed by using xsl:sort in the style sheet of the transformer
  • Japanese language is specified in the sort key of the style sheet of the transformer
The output results of sorting are different in J2SE 5.0 and Java SE 6.
In version 08-70 or earlier versions
Output results of sorting are different in J2SE 5.0 and Java SE 6.
In version 09-00 and later versions
There is no difference as only Java SE 6 is used.
4When the output method is xml, and the characters that cannot be expressed with the specified output encoding are outputThe output results might differ in J2SE 5.0 and Java SE 6.
In versions up to 08-70
The output results might differ in J2SE 5.0 and Java SE 6.
In version 09-00 or later
There are no differences because only Java SE 6 is used.