Scripting reference error in Biztalk 2004 Mapper
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Scripting reference error in Biztalk 2004 Mapper




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Scripting reference error in Biztalk 2004 Mapper  
Adriaan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-03-04 01:47 AM

Hi I am trying to use a regular Expression to remove all line feeds from a s
tring variable in the BizTalk Mapper.

I get the following error when I compile the solution
Inline Script Error: The type or namespace name 'RegularExpressions' does no
t exist in the class or namespace 'System.Text' (are you missing an assembly
 reference?

In fact this is happening to any System.Text class I try to instanciate!!!!

My c# Inline function looks as follows

public string MyConcat(string param1)
{
return System.Text.RegularExpressions.Regex.Replace(param1, @"[^\w\.@-]"
, " ");
}

Any help would be appreciated

Regards

Adriaan










[ Post a follow-up to this message ]



    Re: Scripting reference error in Biztalk 2004 Mapper  
Martijn Hoogendoorn


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-04-04 10:47 PM

On Fri, 3 Sep 2004 14:23:08 +1200, Adriaan wrote:

> Hi I am trying to use a regular Expression to remove all line feeds from a
 string variable in the BizTalk Mapper.
>
> I get the following error when I compile the solution
> Inline Script Error: The type or namespace name 'RegularExpressions' does 
not exist in the class or namespace 'System.Text' (are you missing an assemb
ly reference?
>
> In fact this is happening to any System.Text class I try to instanciate!!!
!
>
> My c# Inline function looks as follows
>
> public string MyConcat(string param1)
> {
>    return System.Text.RegularExpressions.Regex.Replace(param1, @"[^\w\
.@-]", " ");
> }
>
> Any help would be appreciated
>
> Regards
>
> Adriaan

Hi Adriaan,

AFAIK this cannot be done, as you need things outside the System.* scope
and by default, the only "using" statement that's issued is "System" (this
cannot be altered or extended and is performed by
Microsoft.BizTalk.BaseFunctoids.InlineScriptCompiler).

The InlineScriptCompiler has a method called CompileScript, which is used
to compile your script into a temporary object in either implementation
language. It uses CodeDOM and wraps all scripting code for C# with,
generating a proxy dll on the fly, e.g.:

public string MyConcat(string param1)
{
return "test";
}

would become

using System;
namespace BizTalkMapper
{
public class FunctoidInlineScripts {
public string MyConcat(string param1)
{
return "test";
}

}
}

and would be compiled on the spot into an assembly by ICodeCompiler. Any
errors caused by this compilation round, is then feeded back to VS.NET.

I would implement the logic in an external assembly for re-use anyway, and
in there there's no limitation to using clauses. try this:

public string searchReplace(string input, string searchterm, string
replacement)
{
// create a regex object
Regex regex = new Regex(searchterm);

// try to perform a search/replace
string result = Regex.Replace(input, regex.ToString(),
replacement).ToString();
return result;

}

HTH,

Martijn Hoogendoorn.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:54 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register