Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to parse a multipart mime message.

user11992646Mar 20 2010 — edited Mar 22 2010
Hello XML gurus,
We have a need to parse and separate the component documents of a multipart mime XML message into it's individual XML messages. Is there a graceful utllity or way in Oracle to do this? I understand it can be done via sql/pl/sql(using substr, instr etc...) but am checking with you guys whether there is somthing built in already like the multipartmime parser that Java has.
For example the multipart looks something like this. It's all text xml no encoded attachments. My intent is to separate the Document1 and document2, document3 etc... and store in a separate table.
Any advice is greatly appreciated.

Thanks in advance.

Content-Type: multipart/mixed; boundary="----=_Part_ABCDEFG"
------=_Part_ABCDEFG
Content-Type: text/xml; charset=UTF-8
Content-ID: <9999999>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ...>
<XML
Root content document of the multipart mime message-- I don;t need this but nice to have nevertheless</XML>
------=_Part_ABCDEFG
Content-Type: text/xml; charset=UTF-8
Content-ID: <1123456789111111>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ...>
<XML
....DOCUMENT1 - I need to Separate this part out and insert into a table as XMLTYPE or CLOB. We need to extract the text from this later
</XML>
------=_Part_ABCDEFG
Content-Type: text/xml; charset=UTF-8
Content-ID: <1123456789222222>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ...>
<XML
....DOCUMENT2 - I need to Separate this part out, and insert into a table as XMLTYPE or CLOB. We need to extract the text from this later
</XML>
------=_Part_ABCDEFG
....DOCUMENT3 - Separate this part out, insert into table etc.
------=_Part_ABCDEFG
... so on and so forth
------=_Part_ABCDEFG--
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2010
Added on Mar 20 2010
6 comments
3,741 views