Custom Courion Transformation: VB-STRING

I recently ran into a situation where I needed to take the output of a macro and assign it to a variable in a separate VBScript Courion macro.  In order to handle the line returns as well as embedded quotation marks I created a custom transformation.  To implement, simply create a file called CustomTransformations.xml in the CourionServiceTransformations Directory, and include the following XML Code:

<?xml version="1.0" encoding="UTF-8"?>
<transformations>
  <!-- VBScript String Adds leading and trailing quotes,
    escapes internal quotes and handles crlf's-->
  <transformation name="VB-STRING">
    <prefix>"</prefix>
    <replacements>
      <replace from="&quot;" to="&quot;&quot;"/>
      <replace from="&#x000d;&#x000a;" to="&quot; &amp; vbcrlf &amp; &quot;"/>
    </replacements>;
    <postfix>"</postfix>
    <seperator> &amp; "," &amp; </seperator>
  </transformation>
</transformations>

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Social Widgets powered by AB-WebLog.com.