<_x0032_100>
<_x0032_200>
<_x0032_300>
<_x0032_400>
use the following.
1.Create a disassembler pipeline component.
2.Use the following code in the disassemble stage
public void Disassemble(IPipelineContext pc, IBaseMessage inmsg)
{
try
{
// Clone the message context so we can associate it with the new message later
originalMsgContext = PipelineUtil.CloneMessageContext(inmsg.Context);
// create the xml doc
incomingXML.Load(inmsg.BodyPart.GetOriginalDataStream());
splittedNode = incomingXML.SelectSingleNode(strxpath);
}
catch (Exception ex)
{
throw (ex);
}
}
///
Then in the GetNext use something like this....
public IBaseMessage GetNext(IPipelineContext context)
{
XmlDocument currentMessage = new XmlDocument();
IBaseMessage newMsg = null;
List
StringReader strreadRead = new StringReader(splittedNode.OuterXml);
//XLINQ query with year,renderingid and month
var grouped = from c in System.Xml.Linq.XElement.Load(strreadRead).Elements("serviceline") group c by new { year = c.Element("year").Value, renderingid = c.Element("renderingid").Value, month = c.Element("month").Value } into c select c;
foreach (var serviceline in grouped)
{
string strgroup = "<_x0032_200>";
foreach (var temps in serviceline)
{
strgroup += temps.ToString();
strgroup += "\n";
}
strgroup = strgroup + "";
strdocs.Add(strgroup);
strgroup = string.Empty;
}
if ((strdocs.Count > 0) && (splitCounter < editnode =" incomingXML.SelectSingleNode(strxpath);" fragment =" incomingXML.CreateDocumentFragment();" innerxml =" strdocs[splitCounter];" splitcounter =" splitCounter" memstream =" new" newmsg =" context.GetMessageFactory().CreateMessage();" newmsgpart =" context.GetMessageFactory().CreateMessagePart();" data =" memStream;" iprop =" 0;" val =" originalMsgContext.ReadAt(iProp,">
No comments:
Post a Comment