On Thu, Jan 22, 2009 at 11:42:05AM +0530, Rabi Narayan Sahoo wrote:
> Hi 
> 
>   When I perform a sax parsing on the below xml file 
> 
>    <?xml version="1.0"?>
> 
>        <object DN="&amp;&lt;;DN;&gt;@&amp;#&lt;;Attribute;&gt;"
> operation="modify">
> 
>        </object> 
> 
> In the startelementns callback for trigger element the value of the
> attribute DN was $#38;<;DN;> @&#38;#<;Attribute;>
> 
> For all the predefined entities references it replace the corresponding
> character but for amp it
> 
> replace again with a character reference.

  ask for entity replacement.

> As of XML1.0 specification "if a general entity reference appears in the
> value of an attribute its replacement text MUST be processed in place of the
> reference itself."

  libxml2 was designed for editing, the only way to keep editing
  capabilities of entities in attrribute values is to tweak the SAX
  interface. Just ask for entity substitution when  starting the parser
  XML_PARSE_NOENT option IIRC.


Daniel

[...]
> ctxt->replaceEntities. Can anybody please describe why an amp entity
> reference is handled in this manner in SAX?
> 
> Thanks and Regards
> 
>       Rabi

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
[email protected]  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to