After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 131329 - Document::set_internal_subset does not work
Document::set_internal_subset does not work
Status: RESOLVED FIXED
Product: libxml++
Classification: Bindings
Component: DOM Parser
1.0.x
Other All
: Normal normal
: ---
Assigned To: Christophe de Vienne
Christophe de Vienne
Depends on:
Blocks:
 
 
Reported: 2004-01-13 12:08 UTC by guillaume Arreckx
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description guillaume Arreckx 2004-01-13 12:08:30 UTC
The corresponding libxml API xmlCreateIntSubset checks if the externalId or
systemId char pointers are null to determine if the DOCTYPE is a PUBLIC or
SYSTEM.

Since libxml++ passes the content of a string object, the pointers are
never null and the content type is always PUBLIC.

Fix : Since a empty string for the content is meaningless, it can be used
to determine the type of the document :

void Document::set_internal_subset(const std::string& name,
                                   const std::string& external_id,
                                   const std::string& system_id)
{
  const xmlChar* xmlExt = 0;
  const xmlChar* xmlSys = 0;

  if (!external_id.empty())
    xmlExt=(const xmlChar*)external_id.c_str();

  if (!system_id.empty())
    xmlSys=(const xmlChar*)system_id.c_str();

  xmlDtd* dtd = xmlCreateIntSubset(impl_,
                                   (const xmlChar*)name.c_str(),
                                   xmlExt,
                                   xmlSys);

  if (dtd && !dtd->_private)
    dtd->_private = new Dtd(dtd);
}
Comment 1 Christophe de Vienne 2004-01-13 15:23:42 UTC
Trusting your description of the problem, the patch I've commited
fixes the it.
Thanks for reporting it.

Christophe