Attributes - HxGN SDx - 10.0 - Reference - Hexagon

HxGN SDx Connectors XSLT

HxGN SDx Connectors
Search by Category
  • xsl:stylesheet - It is the Root element of XSLT.

    xmlns:xsl - A pseudo-attribute required to identify the document as an XSLT stylesheet.

    Typically this is xmlns:xsl="".

  • msxsl:script - When the style sheet is loaded, any defined functions are compiled to Microsoft Intermediate Language (MSIL) by the Code Document Object Model (CodeDOM) and are executed during run time.

    Required Attributes

    • Version - Specifies the version of XSLT required by this stylesheet.

  • xsl:output - Controls the characteristics of the output document. To function correctly in Netscape, this element along with the method attribute must be used.

    Optional Attributes

    • method - Specifies output format.

    • indent - Specifies if the output should be indented to indicate its hierarchic structure.

      Example: <xsl:output method="text" indent="yes"/>

  • xsl:template - Defines an output producing template. This element must have either the match attribute or the name attribute set.

    Optional Attributes:

    • name - Specifies a name for this template, by which it can be invoked through the <xsl:call-template> element.

    • match - Specifies a pattern that determines the elements for which this template should be used. It is a required attribute if there is no name attribute.

      Example: <xsl:template name="ToUpper" match="ReportAttribute[@AttrDisplayAs='LONG_DESCRIPT']">

  • xsl:param - establishes a parameter by name and, optionally, a default value for that parameter. When used as a top-level element, the parameter is global. When used inside an <xsl:template> element, the parameter is local to that template. In this case it must be the first child element of the template.

    Required Attributes:

    • name - Names the parameter. This must be a QName.

      Example: <xsl:param name="FLNAME"/>

  • xsl:variable - Declares a global or local variable in a stylesheet and gives it a value. Because XSLT permits no side-effects, once the value of the variable has been established, it remains the same until the variable goes out of scope

    Required Attributes:

    • name - Gives the variable a name.

    Optional Attributes:

    • select - Defines the value of the variable through an XPath expression. If the element contains a template, this attribute is ignored.

      Example: <xsl:variable name="LENGTH" select="128" />

  • xsl:value-of - It evaluates an XPath expression, converts it to a string, and writes that string to the result tree.

    Required Attributes:

    • select - Specifies the XPath expression to be evaluated and written to the output tree.

      Example: <xsl:value-of select="@AttrDisplayAs"/>

  • xsl:choose - It defines a choice among a number of alternatives. It behaves like a switch statement in procedural languages.

  • xsl:when - It always appears within an <xsl:choose> element, acting like a case statement.

    Example: <xsl:when test="$SECONDCHAR = ' ' and not(number($FIRSTCHAR) = $FIRSTCHAR) and $STRLEN &lt; 16">

  • xsl:otherwise - It is used to define the action that should be taken when none of the <xsl:when> conditions apply. It is similar to the else or default case in other programing languages.

  • xsl:call-template - It invokes a named template.

    Required Attributes:

    • name - Specifies the name of the template you wish to invoke.

      Example: <xsl:call-template name="record">

  • xsl:with-param - It sets the value of a parameter to be passed into a template.

    Required Attributes:

    • name - Gives this parameter a name.

      Example: <xsl:with-param name="VALUE">

  • xsl:if - It contains a test attribute and a template. If the test evaluates to true, the template is processed. In this it is similar to an if statement in other languages. To achieve the functionality of an if-then-else statement, however, use the <xsl:choose> element with one <xsl:when> and one <xsl:otherwise> children.

    Required Attributes:

    • test - Contains an XPath expression that can be evaluated (using the rules defined for boolean( ) if necessary) to a Boolean value. If the value is true, the template is processed; if it is not, no action is taken.

      Example: <xsl:if test="substring($VALUE,$LENGTH + 1)">

  • xsl:text - It writes literal text to the output tree. It may contain #PCDATA, literal text, and entity references.

  • xsl:apply-templates - It selects a set of nodes in the input tree and instructs the processor to apply the proper templates to them.

    Optional Attributes:

    • select - Uses an XPath expression that specifies the nodes to be processed. An asterisk(*) selects the entire node-set. If this attribute is not set, all child nodes of the current node are selected.

      Example: <xsl:apply-templates select=".//SPFReportItem/ReportAttribute">

  • xsl:for-each - It selects a set of nodes and processes each of them in the same way. It is often used to iterate through a set of nodes or to change the current node. If one or more <xsl:sort> elements appear as the children of this element, sorting occurs before processing. Otherwise, nodes are processed in document order.

    Required Attributes:

    • select - Uses an XPath expression to select nodes to be processed.

      Example: <xsl:for-each select="*[contains($SUPFLOCS,IObject/@Name)]//ReportAttribute[@AttrDisplayAs='SUPFLOC']/@AttrValue">

  • xsl:sort - It defines a sort key for nodes selected by <xsl:apply-templates> or <xsl:for-each> and determines the order in which they are processed.

    Optional Attributes:

    • select - Uses an XPath expression to specify the nodes to be sorted.

    • data-type - Defines whether items are to be ordered alphabetically or numerically. The allowable values are "text" and "number" with "text" being the default.

    • order - Specifies whether the nodes should be processed in "ascending" or "descending" order. The default is "ascending".

      Example: <xsl:sort data-type="number" order="descending" select="(number(contains($SUPFLOCS,IObject/@Name)) * 1)+(number(contains($TWOLEVELFLOCS,IObject/@Name)) * 2)"/>