Changeset 11276

Show
Ignore:
Timestamp:
04/17/07 19:32:30 (2 years ago)
Author:
mloskot
Message:

Fixed handling complex DTD with markup declarations in DOCTYPE element (Ticket #755). The fix just ignores the declaration list block.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/port/cpl_minixml.cpp

    r10645 r11276  
    202202                break; 
    203203            } 
     204             
     205            /* Skip the internal DTD subset as NOT SUPPORTED YET (Ticket #755). 
     206             * The markup declaration block within a DOCTYPE tag consists of: 
     207             * - a left square bracket [ 
     208             * - a list of declarations 
     209             * - a right square bracket ] 
     210             * Example: 
     211             * <!DOCTYPE RootElement [ ...declarations... ]> 
     212             * 
     213             * We need to skip all 3 parts, until closing >  
     214             */ 
     215            if( chNext == '[' ) 
     216            { 
     217                do 
     218                { 
     219                    chNext = ReadChar( psContext ); 
     220                } 
     221                while( chNext != ']' 
     222                    && !EQUALN(psContext->pszInput+psContext->nInputOffset,"]>", 2) ); 
     223 
     224                // Skip "]" character to point to the closing ">" 
     225                chNext = ReadChar( psContext ); 
     226                chNext = ReadChar( psContext ); 
     227            } 
     228 
    204229 
    205230            if( chNext == '\"' ) 
     
    17301755 * @param psTree the document tree to write.  
    17311756 * @param pszFilename the name of the file to write to.  
     1757 * @return TRUE on success, FALSE otherwise. 
    17321758 */ 
    17331759