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 
     * Do this only on a standalone DTD or on the internal subset 
    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
        (dtd->doc->intSubset == dtd))) {
        xmlDumpNotationTable(buf->buffer, (xmlNotationTablePtr) 

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
  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 Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

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