Re: [xml] Predefined Entities Reference problem in SAX parsing
- From: Daniel Veillard <veillard redhat com>
- To: Rabi Narayan Sahoo <rabinarayans huawei com>
- Cc: xml gnome org, ranjit huawei com
- Subject: Re: [xml] Predefined Entities Reference problem in SAX parsing
- Date: Thu, 29 Jan 2009 14:39:44 +0100
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="&<;DN;>@&#<;Attribute;>"
operation="modify">
</object>
In the startelementns callback for trigger element the value of the
attribute DN was $#38;<;DN;> @&#<;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/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]