Re: [xml] SAX and escaped characters

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

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"?>
   <message attr1="hello" attr2="world &amp;!&amp;">hello world</message>

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 Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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