|
Home > Archive > BizTalk Server General > December 2005 > split a multi xml file
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
split a multi xml file
|
|
| Justin Case 2005-12-08, 7:51 am |
| Hello, how can I split this kind of file into many files in Biztalk 2004,
it's all in one file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Message1>
<Content />
</Message1>
<?xml version="1.0" encoding="ISO-8859-1"?>
<Message2>
<Content />
</Message2>
<?xml version="1.0" encoding="ISO-8859-1"?>
<Message3>
<Content />
</Message3>
Thanks bye.
| |
|
| Hello Justin,
On passing the message in, use an envelope and define where you want the
message split.
BizTalk will split the message and then you can act on each one individually.
BA
> Hello, how can I split this kind of file into many files in Biztalk
> 2004, it's all in one file:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <Message1>
> <Content />
> </Message1>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <Message2>
> <Content />
> </Message2>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <Message3>
> <Content />
> </Message3>
> Thanks bye.
>
| |
| Justin Case 2005-12-08, 7:51 am |
| > On passing the message in, use an envelope and define where you want the
> message split.
How do I do that?
| |
| Tomas Restrepo \(MVP\) 2005-12-08, 5:54 pm |
| BA,
>
> On passing the message in, use an envelope and define where you want the
> message split.
>
> BizTalk will split the message and then you can act on each one
> individually.
I don't think you can use an envelope in this case, since what he actually
has is not a single XML document with multiple "records", but instead a
single file containing multiple XML documents that need to be physically
broken appart (notice that each individual document even has it's own
<?xml?> declaration).
I've never tried it, but it seems like the easiest way might be to create a
custom diassembler pipeline component that parses the incoming document in a
very simple way (it can use the root nodes of each individual message or the
xml declarations in them to do the break up), and then uses the
XmlDisassembler underneath to actuall parse each one.
Any other ideas?
| |
|
| Hello Tomas,
You have a point, the XML declarations would probably break the envelopes
ability to split them.
In fact, yes, in this case a custom dissassembler would probably be the easiest
way.
You can fault me for looking at the original xml message too quickly. I
missed the ?xml? :-)
BA
> BA,
>
> I don't think you can use an envelope in this case, since what he
> actually has is not a single XML document with multiple "records", but
> instead a single file containing multiple XML documents that need to
> be physically broken appart (notice that each individual document even
> has it's own <?xml?> declaration).
>
> I've never tried it, but it seems like the easiest way might be to
> create a custom diassembler pipeline component that parses the
> incoming document in a very simple way (it can use the root nodes of
> each individual message or the xml declarations in them to do the
> break up), and then uses the XmlDisassembler underneath to actuall
> parse each one.
>
> Any other ideas?
>
| |
| Justin Case 2005-12-09, 2:50 am |
| > I've never tried it, but it seems like the easiest way might be to create
> a custom diassembler pipeline component that parses the incoming document
> in a
Thanks alot for the answer. I'll look into the FixMsg sample in the SDK,
perhaps I can create a disassembler component for my needs based on that.
Code samples on how to actually implement the parsing would be greatly
appreciated as I'm in no way a c# coder...
| |
|
|
| Justin Case 2005-12-30, 7:55 am |
| I finally resolved this by modifying the FixMsg SDK sample so that it
1) adds an additional root element around the incoming file
2) discards lines starting with the string "<?xml"
so now my output looks like
<root>
<Message1>
<Content />
</Message1>
<Message2>
<Content />
</Message2>
<Message3>
<Content />
</Message3>
</root>
> I don't think you can use an envelope in this case, since what he actually
> has is not a single XML document with multiple "records", but instead a
> single file containing multiple XML documents that need to be physically
> broken appart (notice that each individual document even has it's own
> <?xml?> declaration).
>
> I've never tried it, but it seems like the easiest way might be to create
> a custom diassembler pipeline component that parses the incoming document
> in a very simple way (it can use the root nodes of each individual message
> or the xml declarations in them to do the break up), and then uses the
> XmlDisassembler underneath to actuall parse each one.
>
> Any other ideas?
|
|
|
|
|