Hitachi

uCosminexus Application Server XML Processor User Guide


6.8.3 Notes on XSLT Elements

Table 6‒15: Notes on XSLTC (XSLT elements)

No.

Notes

1

The xsl:apply-imports element is not processed.

2

When the template receives a node set as the parameter by xsl:with-param and you refer to the parameter in the select attribute of the xsl:apply-templates element, you can no longer retrieve the node set even if you refer to the same parameter.

3

If the child element of the xsl:attribute element is xsl:copy, the output attribute value is null.

4

If you specify the xsl:value-of element for the content of the xsl:attribute element, write the XPath expression in the select attribute as an absolute location path.

5

If the xsl:attribute-set element refers to itself (circular reference) in the use-attribute-sets attribute, a stack overflow may occur in XSLTC.

6

If you define multiple xsl:decimal-format elements and every attribute has the same value among those elements, XSLTC reports the error.

7

Do not specify an attribute value template for the name attribute of the xsl:element or xsl:attribute element.

8

When all of the following conditions are met, the namespace to which the element belongs is invalid:

  • There is an xsl:attribute element as a child element of the xsl:element element.

  • The name attribute of the xsl:element element is named with a prefix, and the namespace attribute is specified.

  • The name attribute of the xsl:attribute element is named with a prefix, and the namespace attribute is specified.

  • The prefixes specified in the name attributes of xsl:element and xsl:attribute are identical, and their namespace attribute values are different from each other.

An example of the stylesheet that meets the above cases is as follows:

<xsl:template match="/">

<xsl:element name="child1" namespace="AAA">

<xsl:element name="A:child2" namespace="XXX">

<xsl:attribute name="A:attr" namespace="AAA">1</xsl:attribute>

</xsl:element>

</xsl:element>

</xsl:template>

9

If you specify an XPath expression with a predicate for the select attribute of the xsl:for-each element, do not specify a node-comparison expression for the predicate. In this case, modify the stylesheet as follows:

  1. Delete the predicate from the XPath expression in the select attribute of the xsl:for-each element.

  2. Insert the xsl:if element as a child of the xsl:for-each element, and specify the content of the predicate deleted in step 1 for the test attribute.

An example of the modification of the stylesheet is as follows:

(Before modification)

<xsl:template match="/">

<xsl:for-each select="element[sub='x']">

<xsl:value-of select="."/>

</xsl:for-each>

</xsl:template>

(After modification)

<xsl:template match="/">

<xsl:for-each select="element">

<xsl:if test="sub='x'">

<xsl:value-of select="."/>

</xsl:if>

</xsl:for-each>

</xsl:template>

10

For the select attribute of the xsl:for-each element, do not specify an XPath expression that includes descendant::node() or descendant-or-self::node(). If you want to use the XPath expression above in order to select element and text nodes, modify the stylesheet as follows:

  • Replace descendant::node() with descendant::node()|descendant::text().

  • Replace descendant-or-self::node() with descendant-or-self::node()|descendant-or-self::text().

11

For the test attribute of the xsl:if or xsl:when element, do not specify an XPath expression that has both a self axis and a predicate. In this case, modify the stylesheet as follows:

  1. Delete the predicate from the XPath expression in the test attribute of the xsl:if or xsl:when element.

  2. Insert the xsl:if element as a child of the xsl:if element or xsl:when element, and specify the content of the predicate deleted in step 1 for the test attribute.

An example of the modification of the stylesheet is as follows:

(Before modification)

<xsl:template match="/element/sub">

<xsl:if test="self::sub[attribute::attr='x']">

<xsl:value-of select="."/>

</xsl:if >

</xsl:template>

(After modification)

<xsl:template match="/element/sub">

<xsl:if test="self::sub">

<xsl:if test="attribute::attr='x'">

<xsl:value-of select="."/>

</xsl:if>

</xsl:if >

</xsl:template>

12

If the href attribute value of the xsl:import element is an empty character string or only blank space, an error event occurs and null is output as the error message.

13

Do not specify a pattern that includes node() in the count attribute of the xsl:number element. If you want to use node() in order to number element nodes, use * (asterisk) or the element name instead.

14

If you specify multiple whitespace (tab, space, empty character string) strings, a string of one or more characters, or double-byte characters for the grouping-separator attribute of the xsl:number or the xsl:decimal-format element, an error does not occur and the values delimited by the specified string are output.

15

If you specify / (forward slash) for the count attribute of the xsl:number element, 1 is output in XSLT and a java.lang.VerifyError occurs in XSLTC.

16

If you specify / (forward slash) for the from attribute of the xsl:number element, 1 is output in XSLT and a java.lang.VerifyError occurs in XSLTC.

17

Specify a character string other than the empty character string for the doctype-public attribute of the xsl:output element. Similarly, if you set the doctype-public property by using the setOutputProperty method of the Transformer class, specify a character string other than an empty character string.

18

If you specify XML that is unacceptable as a target name of a processing instruction for the name attribute of the xsl:processing-instruction element, an invalid processing instruction <?XML?> is output.

19

If you specify an invalid value NUMBER (uppercase) for the data-type attribute of xsl:sort, the default behavior (to sort in the same order as when text is specified) is not performed.

20

If you specify an invalid value DESCENDING (uppercase) for the order attribute of xsl:sort, the default behavior (to sort in the same order as when ascending is specified) is not performed.

21

For the match attribute of the xsl:template element, do not specify an XPath expression that includes node() and is followed by a location path. If you want to use node() in order to select element nodes, use an * (asterisk) instead. An example of the modification of the stylesheet is as follows:

(Before modification)

<xsl:template match="/node()/sub">

<result><xsl:value-of select="."/></result>

</xsl:template>

(After modification)

<xsl:template match="/*/sub">

<result><xsl:value-of select="."/></result>

</xsl:template>

22

If you code the top-level element for the child element of the xsl:template element, the top-level element is not ignored and processed as a valid child element.

23

If you code a string function that has a negative zero as the argument for the select attribute of the xsl:value-of element, 0 is output in XSLT, but -0 is output in XSLTC.

24

If you specify the xsl:call-template element for the child element of the xsl:variable element and there is a literal element with a namespace prefix in the template that is called by xsl:call-template, the namespace declaration of the element is not copied properly when you try to copy the element indicated by the variable in the xsl:copy-of element.

25

If you set an extended element by specifying the xsl:extension-element-prefixes attribute for the literal result element, the xsl:fallback element coded as a child element of the extended element may be ignored. Instead, specify the extension-element-prefixes attribute for the xsl:stylesheet element.

26

If you code a child element in an unacceptable location of the stylesheet according to the specifications (for example, when a literal element is coded as a child element of the xsl:stylesheet element or when an xsl:text element appears as a child element of the xsl:namespace-alias element), the invalid child element is ignored without an error occurring.