Answered by:
< and > is coming in xml

Question
-
Hi ,
I am loading xml in orchestration but the xml is coming like
<BTSFaultRoot> <Test >
<EID>EID_0</EID>
</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("<","<");
replaceContent=replaceContent.Replace(">",">");
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.- Proposed as answer by Mohit Kumar Gupta Thursday, September 27, 2012 2:50 PM
- Marked as answer by Leonid GanelineModerator Friday, September 28, 2012 1:21 AM
Thursday, September 27, 2012 2:31 PM
All replies
-
Try
string replaceContent = xml.InnerText;
- Proposed as answer by Mohit Kumar Gupta Thursday, September 27, 2012 2:30 PM
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
- Proposed as answer by Mohit Kumar Gupta Thursday, September 27, 2012 2:30 PM
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.- Proposed as answer by Mohit Kumar Gupta Thursday, September 27, 2012 2:50 PM
- Marked as answer by Leonid GanelineModerator Friday, September 28, 2012 1:21 AM
Thursday, September 27, 2012 2:31 PM