Hi all,

I would like to parse a message, but leave some elements untouched:

This is my XML:

<?xml version="1.0" encoding="UTF-8"?>
<MESSAGE TYPE="start" VERSION="0.1">
    <HEADER>
        <SENDER>jobcontroller</SENDER>
        <RECEIVER>[1006513692672]</RECEIVER>
    </HEADER>
    <BODY>
        <FROM>[EMAIL PROTECTED]</FROM>
        <TO>[EMAIL PROTECTED]</TO>
        <SUBJECT>Simple mail example</SUBJECT>
        <MESSAGE-BODY>
        This is a simple e-mail message,

        Greetings, from Holland!
        </MESSAGE-BODY>
    </BODY>
</MESSAGE>

I'm parsing this using the SAX parser. I would like to end up with a dataobject like this:

myDataObject.sender = "jobcontroller"
myDataObject.receiver = "[1006513692672]"
myDataObject.body = "<FROM>[EMAIL PROTECTED]</FROM><TO>[EMAIL PROTECTED]</TO><SUBJECT>Simple mail example</SUBJECT><MESSAGE-BODY>This is a simple e-mail message,Greetings, from Holland!</MESSAGE-BODY>"

So I don't want to parse the elements inside the <body> tag. I just want to take the literal string inside <body> tags, including the xml-tag that occur inside the <body> tag.
Is there some way to accomplish this?

Many Thanks,


Harm de Laat
Informatiefabriek
The Netherlands

Reply via email to