2017 R1 Update Rollup 1

XSLT ProcessingPermanent link for this heading

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.

XSLT ElementsPermanent link for this heading

For object-based transformations, the following elements and attributes are supported:

  • xsl:stylesheet
  • xsl:include
    • href
  • xsl:template
    • match
    • mode
    • name
    • priority
  • xsl:value-of
    • disable-output-escaping
    • select
  • xsl:apply-templates
    • mode
    • select
  • xsl:call-template
    • mode
    • name
  • xsl:for-each
    • select
  • xsl:output
    • encoding
    • indent
    • omit-xml-declaration
    • standalone
    • version
  • xsl:param
    • name
    • select
  • xsl:if
    • test
  • xsl:choose
  • xsl:when
    • test
  • xsl:otherwise
  • xsl:with-param
    • name
    • select
  • xsl:sort
    • datatype
    • order
    • select
  • xsl:attribute
    • name
    • namespace  
  • xsl:element
    • name
    • namespace
  • xsl:call-template
    • mode
    • name
  • xsl:text
    • disable-output-escaping
  • xsl:number
    • format
    • value
  • xsl:variable
    • name
    • select

XPath EvaluationPermanent link for this heading

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>

LimitationsPermanent link for this heading

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>

Supported FunctionsPermanent link for this heading

If XPath expressions are evaluated in an object context, the following standard XPATH functions are supported:

  • boolean
  • ceiling
  • concat
  • contains
  • count
  • document
  • false
  • floor
  • generate-id
  • id
  • lang
  • last
  • local-name
  • name
  • namespace-uri
  • normalize-space
  • not
  • number
  • position
  • round
  • starts-with
  • string
  • string-length
  • substring
  • substring-after
  • substring-before
  • sum
  • translate
  • true

Additional FunctionsPermanent link for this heading

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:

  • GetObject(string address)
  • GetLanguage(string reference)
  • GetSoftwareProduct(string reference)
  • GetSoftwareComponent(string reference)
  • GetObjectClass(string reference)
  • GetTypeDefinition(string reference)
  • GetAttributeDefinition(string reference)
  • GetCurrentDateTime()
  • GetCurrentDomain()
  • GetCurrentUser()
  • GetCurrentUserEnvironment()
  • GetCurrentUserRoot()
  • GetCurrentUserLanguage()
  • GetCurrentUserRoleGroup()
  • GetCurrentUserRolePosition()
  • GetCurrentUserRoleSubstUser()
  • NodeAttributeDefinition(string node)
  • Evaluate(string expression, optional string globalxpath, optional string localxpath)
  • HasClass(string objaddress, string objclassaddress)
  • IsClass(string objaddress, string objclassaddress)
  • GetReference(optional string objaddress)
  • GetName(optional string objaddress)
  • FormatDate(optional date value, optional string formatpattern)
  • FormatTime(optional time value, optional string formatpattern)

sys:EvaluatePermanent link for this heading

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
<xsl:value-of select="sys:Evaluate('coort.GetVersion()')" />

// the optional parameters are used within the expression
<xsl:value-of select="sys:Evaluate('&quot;Name: &quot; + ::this + &quot; Key: &quot; + :>this', */sys:objname, */sys:objexternalkey)" />

// for enums the integer identifier is returned by default
//
in this way it is possible to print out the enum reference by using globalxpath
<xsl:value-of select="sys:Evaluate('#CurrencySymbol.typeenumvalues[typeenumval==::this].
typeenumref', */my:sum/sys:currsymbol)" />

The result may look like this:

Result

// version
1127

// parameters
Name: Projects Key: projects

// currency
USD