我不知道这个问题是什么,这是一个非常简单的功能,当我关闭SSIS中的编辑器时,我得到“意外的结束标记,第95行,位置87,(mscorlib)”错误。一旦我收到此错误,我将无法再打开脚本任务来编辑代码。我在几台机器上试过这个。它要么崩溃SSIS,要么给我一个错误。
Function XMLWrapper(ByVal name As String, ByVal value As String, ByVal cdata As Boolean) As String
Dim Result As String
If value.Length > 0 Then
If cdata = True Then
Result = vbTab & "<field name=" & name & "><![CDATA[" & value & "]]></field>"
Else '<-- Line 95 where i get the error
Result = vbTab & "<field name=" & name & ">" & value & "</field>"
End If
Else
Result = ""
End If
Return Result
End Function
答案 0 :(得分:0)
通过将代码保存到XML SSIS包中实际上会抛出此错误!
你可以通过分割你的字符串来欺骗它
XMLResult = Replace(XMLResult, "URL>", "URL" & ">" & "<" & "![CDATA")
XMLResult = Replace(XMLResult, "<" & "/" & "JobDetailURL" & ">", "]]" & ">" & "<" & "/" & "JobDetailURL" & ">")
XMLResult = Replace(XMLResult, "<" & "/" & "CompanyURL" & ">", "]]" & ">" & "<" & "/" & "CompanyURL" & ">")
XMLResult = Replace(XMLResult, "<" & "/" & "CompanyImageURL" & ">", "]]" & ">" & "<" & "/" & "CompanyImageURL" & ">")