Re: [xml] SAX and escaped characters



On Wed, Jul 03, 2002 at 12:52:21PM +0200, Marc Ewert wrote:
Hi,

I'm using the SAX-interface of libxml2-2.4.22. If I'm parsing the 
following XML-File:

<?xml version="1.0" encoding="iso-8859-1"?>
<doc>
   <message attr1="hello" attr2="world &amp;!&amp;">hello world</message>
   <epilogue>&amp;ciao&amp;</epilogue>
</doc>

I get "&ciao&" for the element, but "world &amp;!&amp;" for the 
attribute from the parser. Why is the &amp; decoded for the element but 
not for the attribute? Is this a bug, or a feature?

  feature. That's the only way to be able to save back entities used
in attribute values when using the DOM form.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
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]