locked
Script Component Error - Unable to Save Package RRS feed

  • Question

  • I have a script component in a data flow which is bulding an XML string of the column which throws error alongwith the column name and value. Since the column value may contain special characters which may throw off the XML, I am trying to add a CDATA section to the XML string. When I add the CDATA tag in the string, I am unable to Save the package. The error I get is "Failed to Save Data Flow Objects " . My string looks like this:

    strErrorDetails = strErrorDetails &

    " <field name=" & ControlChars.Quote & column.Name.Trim & ControlChars.Quote & _

     

    " value= <![CDATA[" & ControlChars.Quote & strValue & ControlChars.Quote & "]]> />"

    Tuesday, February 1, 2011 6:19 PM

Answers

  • I was able to convert the code to use XML document object and use its CreateCDataSection method to resolve this.

    • Marked as answer by BI Learner Tuesday, February 1, 2011 10:57 PM
    Tuesday, February 1, 2011 10:57 PM

All replies

  • I was able to convert the code to use XML document object and use its CreateCDataSection method to resolve this.

    • Marked as answer by BI Learner Tuesday, February 1, 2011 10:57 PM
    Tuesday, February 1, 2011 10:57 PM
  • Hi.

    I was able to bypass the error with this (silly) code:

      string cdata = "<_!_[_C_D_A_T_A_[{0}]_]_>".Replace("_", "");
    
      file.WriteLine(
        string.Format(@"<server><servername>{0}</servername></server>", 
          string.Format(cdata, Row.server)));
    

    Wednesday, August 14, 2013 10:07 AM