Pravin
Take a Read on understanding 'entity-reference' form the W3C XML 1.0 spec
Martin-
----- Original Message -----
Sent: Sunday, June 19, 2005 5:01 PM
Subject: [castor-user] XML message contains &

While generating XML using castor marshal method; if data object contains ?&? character; it is getting converted into &

How to avoid this? I want the same character  back in XML message. Please help.

 

Sample code:

StringWriter writer = new StringWriter();

String xml = null;

dpMessage.marshal(writer);

xml = writer.toString();

 

 

Input data:

ELLSWORTH & GRAHAM BOOK SHOP Accounts/47-3423230

 

Output xml:

<DPMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="DPMessage">

   <body>

            <detailedSummary>

                <dsCompanyName_TIN>ELLSWORTH &amp; GRAHAM BOOK SHOP Accounts/47-3423230</dsCompanyName_TIN>

            </detailedSummary>

    </body>

</DPMessage>

 

 

Thanks,

Pravin

 

Reply via email to