locked
< and &gt is coming in xml RRS feed

  • Question

  • Hi ,

    I am loading xml in orchestration but the xml is coming like

    <BTSFaultRoot> &lt;Test &gt;
      &lt;EID&gt;EID_0&lt;/EID&gt;
     </BTSFaultRoot>

    the xml dont have end tage of test

    i want subscribe following xml into messagebox

    <BTSFaultRoot> <Test >
     <EID>EID_0</EID>
     </BTSFaultRoot>

    I have implemented below logic but its doesn't work 

    xml=new System.Xml.XmlDocument();
    xml.LoadXml("<BTSFaultRoot></BTSFaultRoot>");
    xml.DocumentElement.InnerText=strContent; //strcontent have xml data
    replaceContent=xml.InnerXml;
    System.Diagnostics.EventLog.WriteEntry("Before Replace",replaceContent);
    replaceContent=replaceContent.Replace("&lt;","<");
    replaceContent=replaceContent.Replace("&gt;",">");
    replaceContent=replaceContent.Replace("<BTSFaultRoot>"," ");
    replaceContent=replaceContent.Replace("</BTSFaultRoot>"," ");
    xml.DocumentElement.InnerText=replaceContent;
    System.Diagnostics.EventLog.WriteEntry("after Replace",xml.InnerXml);

    Thursday, September 27, 2012 12:34 PM

Answers

  • You can only subscribe to valid XML messages, and since you don't have a closing 'Test' tag you won't be able to subscribe to the message.

    Jean-Paul Smit | Didago IT Consultancy
    Blog | Twitter | LinkedIn
    MCTS BizTalk 2006/2010 + Certified SOA Architect

    Please indicate "Mark as Answer" if this post has answered the question.

    Thursday, September 27, 2012 2:31 PM

All replies

  • Try

     string replaceContent = xml.InnerText;

    Thursday, September 27, 2012 12:57 PM
  • but if you will treat it as valid XML then it is not. because End tag required for Elements in XML
    Thursday, September 27, 2012 12:58 PM
  • You can only subscribe to valid XML messages, and since you don't have a closing 'Test' tag you won't be able to subscribe to the message.

    Jean-Paul Smit | Didago IT Consultancy
    Blog | Twitter | LinkedIn
    MCTS BizTalk 2006/2010 + Certified SOA Architect

    Please indicate "Mark as Answer" if this post has answered the question.

    Thursday, September 27, 2012 2:31 PM