Opened 12 years ago

Closed 12 years ago

#2322 closed defect (fixed)

GTiff GDALDriver.GetMetadata() returns malformed xml for DMD_CREATIONOPTIONLIST

Reported by: lpinner Owned by: warmerdam
Priority: normal Milestone: 1.5.2
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: gtiff
Cc:

Description

GDAL version: GDAL 1.5.0, released 2007/12/18

The closing tag of the value elements is lowercase </value> and does not match the opening tag case </Value> for the following:

<Option name='PHOTOMETRIC' type='string-select'>
    ...
    <Value>MINISWHITE</value>
    ....
</Option>
<Option name='PROFILE' type='string-select' default='GDALGeoTIFF'>
    ...
    <Value>GeoTIFF</value>
    ....
</Option>
<Option name='PIXELTYPE' type='string-select'>
    ...
    <Value>SIGNEDBYTE</value>
    ....
</Option>

Python example:

from osgeo import gdal
from xml.dom.minidom import parseString
driver=gdal.GetDriverByName('GTiff')
metadata=driver.GetMetadata()
optionsXML=metadata['DMD_CREATIONOPTIONLIST']
XMLdom=parseString(optionsXML)
  ...
  File "c:\python24\lib\xml\dom\minidom.py", line 1925, in parseString
    return expatbuilder.parseString(string)
  File "c:\python24\lib\xml\dom\expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "c:\python24\lib\xml\dom\expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
ExpatError: mismatched tag: line 1, column 1168
#Workaround:
XMLdom=parseString(optionsXML.replace('</value>','</Value>')) #Malformed XML

Change History (2)

comment:1 Changed 12 years ago by warmerdam

Component: defaultGDAL_Raster
Keywords: gtiff added
Milestone: 1.5.2
Status: newassigned

comment:2 Changed 12 years ago by warmerdam

Resolution: fixed
Status: assignedclosed

Corrected in trunk (r14247), 1.5 branch (r14248) and 1.4 branch (r14249).

Note: See TracTickets for help on using tickets.