The actions COOXML@1.1:XSLTransformObject and COOXML@1.1:XSLTransformToObject operate based on a virtual XML source and target document representing object data in Fabasoft Folio. In order to provide this functionality, Fabasoft Folio implements a subset of XSLT that does not cover all aspects of the standard and shows different behavior in some cases. This chapter provides information on limitations as well as new functionality resulting from this.
If more XSLT functionality is required, XML input/output of these actions should be pre-/post-processed using COOXML@1.1:XSLTransform.
For object-based transformations, the following elements and attributes are supported:
In the context of COOXML@1.1XSLTransformObject and COOXML@1.1:XSLTransformToObject, Fabasoft Folio evaluates XPath expressions based on object data rather than XML data depending on the XSLT context.
In case of COOXML@1.1XSLTransformObject, XPath expressions specified in XSLT elements are evaluated based on object data. Object properties can be accessed directly using XPath expressions.
Example |
---|
<xsl:template match="/"> <name><xsl:value-of select="sys:Value/sys:objname" /></name> </xsl:template> |
In case of COOXML@1.1XSLTransformToObject, XPath expressions specified in XSLT elements are evaluated based on XML input data unless elements are generated that represent object data and disable-output-escaping is enabled.
Example |
---|
<sys:Value ...> <sys:objsubject select="name" disable-output-escaping="yes" /> </sys:Value> |
For object-based transformations, XPath expressions evaluated based on XML input and used with xsl:if or xsl:when must return a list of XML elements rather than a Boolean value.
Example |
---|
<!-- Test for person elements with degree and no publications --> <xsl:template match="person"> <!-- NOT OK --> <xsl:if test="degree and not(publication)"> </xsl:if> <!-- OK --> <xsl:if test="self::node()[degree and not(publication)]"> </xsl:if> </xsl:template> |
If XPath expressions are evaluated in an object context, the following standard XPATH functions are supported:
Fabasoft Folio provides additional XPath functions that can be used in XSLT elements allowing the specification of an XPath expression (e.g. xsl:value-of) in an object context.
Example |
---|
<xsl:value-of select="sys:GetCurrentUser()" /> <sys:objname select="sys:GetCurrentUser()" disable-output-escaping="yes" /> |
The following XPath functions are available:
With the Fabasoft Folio XPath function sys:Evaluate it is possible to evaluate Fabasoft app.ducx Expressions. Additionally to the mandatory expression parameter two more parameters (globalxpath and localxpath) may be defined. The parameters can contain an XPath and the values are accessible within the expression with ::this and :>this.
Example |
---|
// a simple expression is executed // the optional parameters are used within the expression // for enums the integer identifier is returned by default |
The result may look like this:
Result |
---|
// version // parameters // currency |