scalaxb.toXML and XML character reference

134 Views Asked by At

I use scalaxb.toXML to parse an object to xml and send it using soap.

When I have XML character reference in some string property, scalaxb.toXML encodes even the XML character.

How to avoid the encode of XML characters? Or escape it?

My string: Cancellation Fees 

 - Until 30 days before departure: 20% of the product price

My result (cleaned up):

<soap11:Envelope xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" ...>
    ...
    <mbm:order-remark text="Cancellation Fees &amp;#xd;&amp;#xa;&amp;#xd;&amp;#xa; - Until 30 days before departure: 20% of the product price" position="0" />
    ...
</soap11:Envelope>

Each & is being encoded to &amp; to avoid structural problems with my XML, even when they are valid.

How I call scalaxb.toXML:

scalaxb.toXML(obj, namespace, elementLabel, scope)
0

There are 0 best solutions below