www.altova.com
Previous  Top  Next

XSLT 1.0 Engine: Implementation Information


The Altova XSLT 1.0 Engine is built into Altova's XMLSpy, StyleVision, Authentic, and MapForce XML products. It is also available in the free AltovaXML package. The Altova XSLT 1.0 Engine implements and conforms to the World Wide Web Consortium's XSLT 1.0 Recommendation of 16 November 1999 and XPath 1.0 Recommendation of 16 November 1999. Limitations and implementation-specific behavior are listed below.

 

 

Limitations

 

The xsl:preserve-space and xsl:strip-space elements are not supported.
When the method attribute of xsl:output is set to HTML, or if HTML output is selected by default, then special characters in the XML or XSLT file are inserted in the HTML document directly as special characters; they are not inserted as HTML character references in the output. For instance, the character   (the decimal character reference for a non-breaking space) is not inserted as   in the HTML code, but directly as a non-breaking space.

 

 

Implementation's handling of whitespace-only nodes in source XML document

The XML data (and, consequently, the XML Infoset) that is passed to the Altova XSLT 1.0 Engine is stripped of boundary-whitespace-only text nodes. (A boundary-whitespace-only text node is a child whitespace-only text node that occurs between two elements within an element of mixed content.) This stripping may have an effect on the value returned by the fn:position(), fn:last(), and  fn:count() functions.

 

For any node selection that selects text nodes also, boundary-whitespace-only text nodes would typically also be included in the selection. However, since the XML Infoset used by the Altova engines has boundary-whitespace-only text nodes stripped from it, these nodes are not present in the XML Infoset. As a result, the size of the selection and the numbering of nodes in the selection will be different than that for a selection which included these text nodes. The fn:position(), fn:last(), and  fn:count() functions, therefore, could produce results that are different from those produced by some other processors.

 

A situation in which boundary-whitespace-only text nodes are evaluated as siblings of other elements arises most commonly when xsl:apply-templates is used to apply templates. When the fn:position(), fn:last(), and fn:count() functions are used in patterns with a name test (for example, para[3], which is short for para[position()=3]), boundary-whitespace-only nodes are irrelevant since only the named elements (para in the above example) are selected. (Note, however, that boundary-whitespace-only nodes are relevant in patterns that use the wildcard, for example, *[10].)

 

Note: If a boundary-whitespace-only text node is required in the output, then insert the required whitespace within one of the two adjoining child elements. For example, the XML fragment:

 

<para>This is <b>bold</b> <i>italic</>.</para>

 

when processed with the XSLT template

 

<xsl:template match="para">

       <xsl:apply-templates/>

</xsl:template>

 

will produce:

 

This is bolditalic.

 

To get a space between bold and italic in the output, insert a space character within either the <b> or <i> elements in the XML source. For example:

 

<para>This is <b>bold</b> <i> italic</>.</para> or

<para>This is <b>bold&#x20;</b> <i>italic</>.</para> or

<para>This is <b>bold</b><i>&#x20;italic</>.</para>

 

When such an XML fragment is processed with the same XSLT template given above, it will produce:

 

This is bold italic.

 


Previous  Top  Next

© 2008 Altova