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



On Wed, Sep 26, 2007 at 02:28:15PM +0500, Ahmad Jalil Qarshi wrote:

   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.

  Your 'other third party application' is hence not XML conformant. There
is no solution in libxml2 or in the XML space for this. Either get this
fixed or don't use XML.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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