[xml] Problem while inserting & as an attribute Value.



Hi,

I have to generate an xml file and send it to some other third party application for processing. My XML file looks like

<?xml version="1.0"?>
<!DOCTYPE RequestMessage SYSTEM "RequestMessage.dtd ">
<RequestMessage>
  <Header>
    <RequestID>1190795903</RequestID>
  </Header>
  <Body>
    <Password>@P8x&.?P</Password>
  </Body>
</RequestMessage>

Now when I try to insert a new Node <Password> along with some specific value containing & (ampersand) sign it generates an error message
error : unterminated entity reference          .?P

I know that for displaying & sign we can use &amp; but I can't use it here, because the other third party application will consider it as part of the password.

Kindly provide me some solution.

Regards

Ahmad Jalil Qarshi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]