如何在 BizTalk XLANG 中将字符串转换为 int 变量?

How do I convert a string to an int variable in BizTalk XLANG?

我有以下 XPath 表达式,它从文件中分配一个值,但它是一个字符串,我需要在 XLANG 中转换为一个 int 变量,但现在确定语法

nrOfRecordsstr= xpath(CaseIn,"/*[local-name()='CaseFile' and namespace-uri()='http://xx.com/casefile']/*[local-name()='Header' and namespace-uri()='']/*[local-name()='NrofRecords' and namespace-uri()='']");

nrofRecorsint=??

我不知道 BizTalk,但在 XPath 中你可以使用 number() 函数来 return 数字而不是字符串。因此,假设您的初始 XPath 表达式 return 奇异值,您可以从用 number() 包装它开始,像这样:

number(/*[local-name()='CaseFile' and namespace-uri()='http://xx.com/casefile']/....)

可以使用System.Convert.ToInt32(string s);

nrOfRecordsstr = xpath(CaseIn,"/*[local-name()='CaseFile' and namespace-uri()='http://xx.com/casefile']/*[local-name()='Header' and namespace-uri()='']/*[local-name()='NrofRecords' and namespace-uri()='']");
nrofRecorsint = System.Convert.ToInt32(nrOfRecordsstr);