Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1170

internal subset lost after using cloneNode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • DOM
    • None
    • Operating System: Windows NT/2K
      Platform: PC
    • 27375

    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/>"

      Attachments

        Activity

          People

            Unassigned Unassigned
            kristone@hotmail.com Old Account That Somhow Should Be Erased
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: