com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.

XQuery Mediator

The XQuery Mediator performs an XQuery transformation on messages. 

The XQuery mediator is a content aware mediator.



Syntax

<xquery key="string" [target="xpath"]>
    <variable name="string" type="string" [key="string"] [expression="xpath"] [value="string"]/>?
</xquery>

UI Configuration

The parameters available to configure the XQuery mediator are as follows.

Parameter NameDescription
Key Type

This parameter specifies whether the key which represents the XQuery transformation should be a static key or a dynamic key.

  • Static: If this is selected, the key would be a static value. This value should be selected from the Registry for the Key parameter.
  • Dynamic: If this is selected, the key would be a dynamic value which has to be evaluated via an XPath expression. The relevant XPath expression can be entered in the Key parameter.
Key

The key that represents the XQuery transformation. The value you enter depends on the value you selected for the Key Type parameter. If you selected Static for the Key Type parameter, click Configuration Registry or Governance Registry as relevant to select the key from the resource tree. If you selected Dynamic for the Key Type parameter, enter the XPatch expression which calculates the dynamic key.

 

You can click NameSpaces to add namespaces if you are providing an expression. Then the Namespace Editor panel would appear where you can provide any number of namespace prefixes and URLs used in the XPath expression. 


Target

This parameter specifies the node of the message to which the XQuery transformation should be applied. The node is evaluated via an XPath expression. If no value is specified for this parameter, the XQuery transformation is applied to the first child of the SOAP body.

You can click NameSpaces to add namespaces if you are providing an expression. Then the Namespace Editor panel would appear where you can provide any number of namespace prefixes and URLs used in the XPath expression. 

Add Variable

This link allows you to define one or more variables that could be bound to the dynamic context of the XQuery engine in order to be accessed during the XQuery script invocation.

Click Add Variable to add a variable to the XQuery mediator configuration. The page will expand to display parameters relating to variables. The parameters displayed would differ depending on whether you select Value or Expression as the variable value type. Click on the relevant tab below to view the relevant UI configuration for variables.

Note

You can configure the mediator using XML. Click switch to source view in the Mediator window.


Examples

In this configuration, the XQuery script is saved in the registry, and it can be accessed via the xquery\example.xq key. The XQuery configuration has one variable named payload of which the variable type is ELEMENT.  As there is no expression in the variable definitions, the default value of the first child of the SOAP Body is used as the value of the variable payload. Within the XQuery script, you can access this variable by defining declare variable $payload as document-node() external;.

<xquery key="xquery\example.xq">
      <variable name="payload" type="ELEMENT"/>
</xquery>
Variables

The following variable picks an XML resource from the registry using key misc/commission.xml and binds into XQuery Runtime so that it can be accessed within the XQuery script.

<variable name="commission" type="ELEMENT" key="misc/commission.xml"></variable>


The value of the following variable is calculated from the current message SOAP Payload using an expression. The value type of the variable is DOUBLE.

<variable name="price" type="DOUBLE" expression="self::node()//m0:return/m0:last/child::text()" xmlns:m0="http://services.samples/xsd"/>

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.