Re: [xml] Parameter-Entity in CDATA block not getting replaced



On Thu, Mar 13, 2008 at 02:43:15PM +0530, Ashwin wrote:
Hi,

       For the attached files the parameter entity inside the CDATA block is
not getting replaced.

  In the future please add the xmllint command used to reproduce the problem
that way I won't loose any extra time finding what exactly is going wrong.

Ideally after replacement the CDATA content should be <!ATTLIST root attr1
NMTOKEN "attrvalue">, however the PE entity replacement is going wrong and
the content is being returned as NULL. The problem occurs at line 2314 in
parser.c, there is a function call to xmlParseStringPEReference, for the PE
inside the Cdata block, which in turn calls the xmlGetParameterEntity, and
then does a hashlookup, from the xmlGetEntityFromTable function. However the
entity pointer returned contains the content as Empty instead of <!ATTLIST
root attr1 NMTOKEN "attrvalue">. I think the content should not be empty,
its probably happening because somehow the parser is not able to read the
entity content in external2.ent..

  Rather hard problem, basically an external system parsed entity referenced
from the external subset in a location where it need to be included in litteral
and well libxml2 was not loading the content of the entity in that case.
Proper fix is not trivial, abut it's now fixed in SVN, and added to the 
regression tests, see
   ./xmllint --valid --noent --debugent test/valid/t11.xml

after updating from SVN, it shows the problem is fixed, and the test case
is added to the regression tests.

  thanks,

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]