Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Overview    

...

The sample of XSLT instruction and script is shown below:

BL_Config.xml:

 

Code Block
languagehtml/xml
<!DOCTYPE FIXEdge SYSTEM "BusinessLayer.dtd">
<FIXEdge>
  <!-- All rules are applied independently --> 
  <BusinessLayer>
    <!-- The first rule.--> 
    <Rule>     
      <!-- Check where the message is received from --> 
      <Source>
        <!-- Message received from any FIX session --> 
        <FixSession SenderCompID=".*" TargetCompID=".*"/>
      </Source>
      <!-- Check the message content --> 
      <Condition>
        <!-- Message with any value of MsgType --> 
        <MatchField Field="35" Value=".*"/>
      </Condition>
      <!-- Apply action if Source and Condition succeeded --> 
      <Action>
        <!--
          -- Apply XSLT script from file 'script1.xslt' to the value
          -- of FIX field 213; since 213 is a RawData field the field
          -- 212 that contains its length is also mentioned.
          -- String ' world' will be used to substitute parameter with name
          -- 'param1'; String '!' will be used to substitute parameter
          -- with name 'param2';
          --> 
        <Script Language="XSLT" Field="213" LengthField="212" FileName="script1.xslt" >
            <Param Name="param1">' world'</Param>
            <Param Name="param2">'!'</Param>
        </Script>
        <!-- Send message --> 
        <Send>
          <!--
            -- Send message to the FIX session according to the SenderCompID
            -- and TargetCompID fields in this message.
            --> 
          <FixSession />
        </Send>
      </Action>
    </Rule>
  </BusinessLayer>
</FIXEdge>

 

script1.xslt:

 

Code Block
languagehtml/xml
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output encoding='US-ASCII'/>
<!-- Declaration of the parameter with the default value --> 
<xsl:param name="param1" select="'default value'"/>
<!-- Declaration of the parameter with the default value --> 
<xsl:param name="param2" select="'default value'"/>
<!-- Find '<doc>' element inside XML --> 
<xsl:template match='doc'>
    <!-- Replace with '<out>' element --> 
  <out>
    <!-- Remain text in element unchanged --> 
    <xsl:value-of select="."/>
    <!-- Append value of the first input parameter --> 
    <xsl:value-of select="$param1"/>
    <!-- Append value of the second input parameter --> 
    <xsl:value-of select="$param2"/>
  </out>
</xsl:template>
</xsl:stylesheet>

...