[gdal-dev] ogr2ogr explanations for error XML parsing of GML file failed?

Jeroen Hovens jeroen at groenebij.nl
Mon Jan 12 12:22:19 PST 2026


Okay, so I actually stumbled upon a GDAL bug, cool.

 

I think another workaround could be to edit the QGIS variable setting in Options>System



But I do not know if this will introduce other issues in QGIS 😊

 

Just to let you know, I just tried this approach, which indeed results in the VSI_CACHE variable not being listed anymore when typing set

AND the WFS to gpkg conversion was successful.

 

 

Thanks,

Jeroen

 

Van: Even Rouault <even.rouault at spatialys.com> 
Verzonden: maandag 12 januari 2026 19:07
Aan: Jeroen Hovens <jeroen at groenebij.nl>
CC: gdal-dev at lists.osgeo.org
Onderwerp: Re: [gdal-dev] ogr2ogr explanations for error XML parsing of GML file failed?

 

ok,

so the issue was related to QGIS setting VSI_CACHE=YES, which triggered a bug in /vsicurl_streaming/

So the workaround is that you type "set VSI_CACHE=" in the QGIS console

Proper fix queued in https://github.com/OSGeo/gdal/pull/13690

Even

Le 12/01/2026 à 17:59, Jeroen Hovens a écrit :

Hi Even,

 

Find attached two txt files.

env_var_winprompt is the normal windows prompt terminal after adding the QGIS bin folder to path

env_var_qgisterminal is the QGIS terminal as is, no changes made

 

Jeroen

 

 

Van: Even Rouault  <mailto:even.rouault at spatialys.com> <even.rouault at spatialys.com> 
Verzonden: maandag 12 januari 2026 17:34
Aan: Jeroen Hovens  <mailto:jeroen at groenebij.nl> <jeroen at groenebij.nl>; gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org> 
Onderwerp: Re: [gdal-dev] ogr2ogr explanations for error XML parsing of GML file failed?

 

Hi Jeroen,

can you type "set" to list environment variables that are defined, both in a terminal from QGIS or the Windows prompt, (possibly redirecting to file, like "set > env_vars.txt"), and compare the differences

Even

Le 12/01/2026 à 17:06, Jeroen Hovens via gdal-dev a écrit :

Hi,

 

I use QGIS on Windows10 which comes with GDAL. The latest QGIS LTR (3.40.14) uses GDAL 3.12.1

In QGIS I can open a terminal (browser panel, rightclick a folder and select Open in Terminal) and immediately use ogr2ogr to convert a WFS to a geopackage, because QGIS has altered the path to include the GDAL directory

However, with some WFS services ogr2ogr throws an error. I have no trouble using those WFS services in QGIS.

 

For instance, this one I can’t convert:

ogr2ogr -f gpkg test.gpkg WFS: <https://service.pdok.nl/kadaster/bestuurlijkegebieden/wfs/v1_0?> "https://service.pdok.nl/kadaster/bestuurlijkegebieden/wfs/v1_0?" Provinciegebied -overwrite -nln provincie_kadaster

But this one I can:

ogr2ogr -f gpkg test2.gpkg WFS: <https://map.data.amsterdam.nl/maps/gebieden> "https://map.data.amsterdam.nl/maps/gebieden" wijk -overwrite -nln amsterdam_wijk

 

The first WFS is part of a large Dutch open data organization and depending on which WFS  I choose from them I see two different errors:

ERROR 1: XML parsing of GML file failed : no element found at line 27, column 31065   (or different numbers)

Or

ERROR 1: XML parsing of GML file failed : unclosed token at line 555, column 9

 

I was able to compare a debug on with someone who was able to convert the WFS to a gpkg and this part was surely different

VSICURL: Read attempt beyond end of file

VSICURL: Read attempt beyond end of file

 

After this, the error appeared.

 

 

To make things more complicated:

When I open a Windows Prompt (terminal) and set a path to the GDAL directory in QGIS using set PATH=%PATH%;C:\Program Files\QGIS 3.40.14\bin

I can also use ogr2ogr.

Interestingly, now I can convert both WFS datasets to gpkg.

 

What could be different with the QGIS Terminal setting from a Windows Prompt setting with the path set that would explain the errors?

What might be different in both WFS services that triggers these errors?

 

 

 

Kind regards,

 

Jeroen Hovens

 

 

 

 

 

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org> 
https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20260112/c865bed7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7059 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20260112/c865bed7/attachment-0001.png>


More information about the gdal-dev mailing list