Re: [xml] question about dumping notations from extSubset



On Fri, Oct 31, 2008 at 04:24:34PM +0100, Petr Pajas wrote:
Hi Daniel, All,

I want to use xmlNodeDump on doc->extSubset but the output does not 
contain any <!NOTATION...> declarations. 

In xmlDtdDumpOutput there is the following comment and code:

    /*
     * Dump the notations first they are not in the DTD children 
list
     * Do this only on a standalone DTD or on the internal subset 
though.
     */
    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
        (dtd->doc->intSubset == dtd))) {
        xmlDumpNotationTable(buf->buffer, (xmlNotationTablePtr) 
dtd->notations);
    }

Clearly the behavior I see is intended. Can you please explain why 
is it so, i.e. why this function should only dump the notation 
declarations for a standalone DTD or internal subset and not for an 
external subset? Thanks,

  I think this was to avoid dumping notations which were coming
from the external subset of the document when saving the document
itself. One trick would be to set dtd->doc to NULL before calling
xmlDtdDumpOutput.
  Note that this won't match the external subset, you will only get
a single 'flat' file output of the subset in use, but this can be
useful sometimes.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]