[Gdal-dev] testing of CDATA support in GDAL/OGR

Frank Warmerdam warmerdam at pobox.com
Thu Mar 15 12:35:07 EDT 2007

Kralidis,Tom [Burlington] wrote:
> Hi,
> Using GDAL/OGR 1.4.0 (02 January 2007) on an FC4 box, we're testing CDATA
> block support within XML documents which are processed by GDAL/OGR (our
> target need is WMC docs in MapServer).
> I've tested using a GML document with a CDATA block to an attribute element:
> <![CDATA[iGEORGIAN BAY <tom>]]>  when doing a:  $ ogrinfo -al foo.gml  The
> attribute is shown as:  iGEORGIAN BAY  When I test a special char:  
> <![CDATA[iGEORGIAN BAY & <tom>]]>  the result of the output shapefile
> attribute is:  iGEORGIAN BAY  From what I can see, this code is in
> port/cpl_minixml.cpp.  Is this the intended behaviour?


I tried this and it seems to work fine for me.  I embedded your CDATA
block in an existing GML as an attribute and got:

   ISLAND_F (String) = iGEORGIAN BAY & <tom>

Could you submit a specific (modestly sized) GML document via a GDAL
bug in bugzilla for us to try and reproduce this problem?

Note that the OGR GML driver actually uses Xerces, not cpl_minixml for
the bulk of it's processing, so this should be unrelated to cpl_minixml.
If you want to test the minixml code, you can build xmlreformat in
gdal/port and use that.  I have also verified that it is handling
CDATA properly, though it was added only a few weeks before the GDAL/OGR
1.4.0 release.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list