Details
Description
If you have document with an internal DTD (doctype) that contains an internal
subset (e.g. notations, entities etc), then clone the whole document, using
cloneNode and use DOMWriter to write the cloned document, there is no internal
subset there.
Both enities and notation are still in the DTD though and can be reached via
the DOMDocumentType::getEntities() and DOMDocumentType::getNotations() methods
It seems like the internal subset looses it's specified value !
original xml:
"<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE pictures [<!NOTATION tiff SYSTEM 'image/tiff'> <!ENTITY PICTURE
SYSTEM 'image.tif' NDATA tiff> <!ELEMENT pictures (#PCDATA)>]>
<pictures/>"
// code start
...
xercesc::DOMDocument * document =
parser->getDocument()->cloneNode( true );
...
writer->writeNode( &target, *document);
...
// code end
result xml:
"<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE pictures>
<pictures/>"