GNOME Bugzilla – Bug 131329
Document::set_internal_subset does not work
Last modified: 2004-12-22 21:47:04 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); }
Trusting your description of the problem, the patch I've commited fixes the it. Thanks for reporting it. Christophe